def foo():
global x
x += 1
print(x)
x = 12
foo()
print(x)
Options:
Explanation
Correct answer is : B
Inside the function foo() we are changing the value (12) of the global variable "x" (adding 1 to it), which becomes 13 So print(x) will print 13 everywhere as it is global variable
Comment here: