We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b33d98b commit 4d775d7Copy full SHA for 4d775d7
1 file changed
v3/example-code/nonlocal.txt
@@ -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