Python基础——全局变量与Global关键字

1.局部变量会掩盖同名的全局变量
2.使用global关键字声明,在函数中给全局变量赋值。

猜你喜欢

转载自blog.csdn.net/weixin_42836351/article/details/82595227