is_this_global = 'xyz'
def foo():
global is_this_global
this_is_local = 'abc'
is_this_global = 'def'
print this_is_local + is_this_global
转载于:https://www.cnblogs.com/dflyingfish/p/5062027.html
is_this_global = 'xyz'
def foo():
global is_this_global
this_is_local = 'abc'
is_this_global = 'def'
print this_is_local + is_this_global
转载于:https://www.cnblogs.com/dflyingfish/p/5062027.html