What is the output of the following code?
X = 'Test' def func(): X = 'book2s.com!' func() print(X)
Test
Assigning the variable inside the function makes it a local and effectively hides the global of the same name.
The print statement finds the variable unchanged in the global (module) scope.