def f():
x = 1
y = 2
def g():
nonlocal x
print(y)
try:
print(x)
except NameError:
print("NameError")
def h():
del x
print(x, y)
g()
h()
f()