We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b6eadcc commit 59a616cCopy full SHA for 59a616c
1 file changed
python-namespace/scopes.py
@@ -1,13 +1,18 @@
1
global_variable = "global"
2
+
3
4
def outer_func():
5
# Nonlocal scope
6
nonlocal_variable = "nonlocal"
7
8
def inner_func():
9
# Local scope
10
local_variable = "local"
11
print(f"Hi from the '{local_variable}' scope!")
12
print(f"Hi from the '{nonlocal_variable}' scope!")
13
print(f"Hi from the '{global_variable}' scope!")
14
15
inner_func()
16
17
18
outer_func()
0 commit comments