What is the output of the following code?
X = 'Test' def func(): X = 'test' def nested(): print(X) nested() func() print(X)
test Test
The print statement in the nested function finds the name in the enclosing function's local scope, and the print at the end finds the variable in the global scope.