codingpython
global - update from a function
Implement func() so that it updates global variable x to be 20. print() should output 20.
pythonx = 10
def func():
# Implementation...
func()
print(x)Implement func() so that it updates global variable x to be 20. print() should output 20.
pythonx = 10
def func():
# Implementation...
func()
print(x)