Test global variable access.
This commit is contained in:
parent
22635900ee
commit
cc050dad9f
14
main.py
14
main.py
@ -1,6 +1,10 @@
|
||||
#Python unpack testing
|
||||
numbers = [1, 2, 3]
|
||||
x, y, z = numbers
|
||||
#Global test
|
||||
x = 0
|
||||
print(x)
|
||||
print(y)
|
||||
print(z)
|
||||
|
||||
def myfunc():
|
||||
global x
|
||||
x = 1
|
||||
print(x)
|
||||
|
||||
myfunc()
|
||||
|
Loading…
x
Reference in New Issue
Block a user