Python - What is the output: reference global variable?

Question

What is the output of the following code?

X = 'Test' 
def func(): 
    print(X) 

func() 


Click to view the answer

Test

Note

The function references a global variable in the enclosing module.

Related Quiz