print('global sample1')
x = 1
def a():
x=2
print(x)
a()
print(x)
print('global sample2')
x = 1
def a():
global x
x +=1
y = 1
print(x, y)
a()
print(x)
a()
print('global sample3')
def a():
global x
x =1
y = 1
print(x, y)
a()
x +=1
print(x)
a()
print('global sample4')
def a(y):
global x
x =1
y = 1
print(x,y)
a(1)
x +=1
print(x)
a(1)
print('global sample5')
def a():
global x
x =1
print(x)
def b():
a()
b() #run
x +=1
print(x) #run
print('global sample6')
def a(y):
global x
x =1
y +=1
print(x)
def b():
a(1)
b() #run
x +=1
print(x) #run
print('global sample7')
def a(y):
global x
x =1
y +=1
print(x)
def b():
def c():
a(1)
c()
b() #run
x +=1
print(x) #run
print('global sample8')
def a():
print(x)
def b():
global x
x = 1
#local y
def c():
def d():
y = 2
print(y)
a()
d()
c()
b()
print('global sample10')
def a():
print(x)
def b():
global x
x = 1
#local y
def c():
y = 2
def d():
print(y)
a()
d()
c()
b()
print('global sample9')
def a():
print(x)
def b():
global x
x = 1
#local y
def a():
print('I am from function a')
def c():
def d():
y = 2
print(y)
a()
d()
c()
b()
print('global sample11')
def a():
print(x)
y = 0
def b():
global x
x = 1
y = 2
def c():
nonlocal y
y = y + 1
def d():
nonlocal y
y = y + 1
#print(y)
a()
d()
c()
print(y)
b()
print(y)
dic = {'a':1,"b":2,"c":a}
dic = ['c']()