x = 10
y = 20
def foo():
global y
x = 45
y = 56
foo()
print(x, y)
Options:
Explanation
Correct answer is : A
global y will make the variable "y" to become global inside the function block and x remains local to the function So any change to "y" will reflect in global scope and y becomes 56 after function call The output will be 10 56
Comment here: