You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
352 B
23 lines
352 B
11 years ago
|
def f():
|
||
|
x = 1
|
||
|
y = 2
|
||
|
def g():
|
||
|
nonlocal x
|
||
|
print(y)
|
||
|
try:
|
||
|
print(x)
|
||
|
except NameError:
|
||
|
print("NameError")
|
||
|
def h():
|
||
|
nonlocal x
|
||
|
print(y)
|
||
|
try:
|
||
|
del x
|
||
|
except NameError:
|
||
|
print("NameError")
|
||
|
print(x, y)
|
||
|
del x
|
||
|
g()
|
||
|
h()
|
||
|
f()
|