x = 5
def foo():
global x
x = 4
def bar(a, b):
global x
return a + b + x
foo()
print(bar(7, 8))
Options:
Explanation
Correct answer is : B
The global variable "x" value will be changed to 4 when foo() is called Inside function bar() , the global variable "x" value will be 4 and getting added to 7 and 8 in statement a + b + x, when bar() is called
Comment here: