#coding=utf-8
def local():
x = 2
print "x is:", x
print "So, we defien local x 2."
x = 50 #主块X
test() #运行函数
print "X outside function is still the same", x #证明运行函数没有影响主块X的值。
def global():
global y
y =2
print "y is:", y
print "change local y to,", y
y = 50 #主块y
test_2() #运行函数
print "The values of y is,", y #证明运行函数影响了主块y的值