Correct answer is : D
- We are passing 34 to scopetest, so
print('x == ', x)
will print x == 34
- But Inside the function body we are reassigning x to 2 and as we have not made x to global using global keyword x remain local to the function body.
So print('X is changed to == ', x)
will print X is changed to == 2
- After the unction call
print('x is at outer scope', x)
will print 34 as x value is 34 in global scope
Discuss It
Comment here: