Skip to content

Commit 4d775d7

Browse files
author
Philip Guo
committed
bah
1 parent b33d98b commit 4d775d7

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

v3/example-code/nonlocal.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# 'nonlocal' keyword is only in Python 3
2+
def outer():
3+
x = 1
4+
def inner():
5+
nonlocal x
6+
x = 2
7+
print("inner:", x)
8+
inner()
9+
print("outer:", x)
10+
11+
outer()

0 commit comments

Comments
 (0)