Skip to content

Commit a3471ec

Browse files
committed
committed from zkp
1 parent 1cd45d8 commit a3471ec

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

original/nonlocal_and_global.pyi

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
def scope_test():
2+
def do_local():
3+
spam = "local spam"
4+
def do_nonlocal():
5+
nonlocal spam
6+
spam = "nonlocal spam"
7+
def do_global():
8+
global spam
9+
spam = "global spam"
10+
spam = "test spam"
11+
do_global()
12+
print("After local assignment:", spam)
13+
do_nonlocal()
14+
print("After nonlocal assignment:",spam)
15+
do_global()
16+
print('After global assignment:',spam)
17+
18+
scope_test()
19+
print("In global assignment",spam)

0 commit comments

Comments
 (0)