梗概

python不同于其他语言, 使用全局变量时需要手动指定全局变量

语法

1. 在外部声明全局变量

global 变量名

2. 在局部作用域使用全局变量

global 变量名
变量名=