11 lines
209 B
Python
11 lines
209 B
Python
|
def foo():
|
||
|
x = 10
|
||
|
def bar():
|
||
|
def tar():
|
||
|
nonlocal x # foo'daki x
|
||
|
x = 20
|
||
|
tar()
|
||
|
bar()
|
||
|
print(x) # 20
|
||
|
foo()
|