global 的作用

a = 10
def test():
    global a
    a = 5
    print(a)
test()
print(a)

原文地址:https://www.cnblogs.com/zhenyu1/p/14708770.html