conceptual
global - in outer and inner functions
What does this code output?
pythondef func():
global x
x = 15
def inner():
global x
x = 20
print(x)
inner()
print(x)
func()
print(x)What does this code output?
pythondef func():
global x
x = 15
def inner():
global x
x = 20
print(x)
inner()
print(x)
func()
print(x)