A,B,C are correct in this case
var = 1
def f():
global var
var += 1
def g():
return var
return g
a = f()
b = f()
print(a() > 2) #A, True
print(a is not None) #B, True
print(b() > 2) #C, True
print(a is b) #D, False
It depends at what step is a() is executed. If a() is run after invoking b=f(), then both a() and b() return 3 and in that case A,B and C are correct. But if a() is run before invoking b=f(), then a() returns 2 and b() returns 3 and in this case B and C are correct.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
zwakenberg
4 weeks, 1 day agorahulgcp87
2 months, 1 week agoflthymcnsty
3 months, 2 weeks ago