What is the output of this code?
x, y = 1, 2
def foo():
global y
if y == 2:
x = 2
y = 1
foo()
print(x)
if y == 1:
x = 3
print(x)What is the output of this code?
x, y = 1, 2
def foo():
global y
if y == 2:
x = 2
y = 1
foo()
print(x)
if y == 1:
x = 3
print(x)Create a free account to access the full topic