首页
技术
登录
6mi
u
盘
搜
搜 索
技术
python的全局变量 local variable ‘xxx‘ referenced before assignment
python的全局变量 local variable ‘xxx‘ referenced before assignment
技术
2022-07-10
128
在python中一个方法中更改全局变量出错 解决方法:在这个方法体中给全局变量前加global
errorTimes
=
0 def f
(
)
: global errorTimes errorTimes+
=
1 print
(
errorTimes
)
转载请注明原文地址:https://ipadbbs.8miu.com/read-7175.html
最新回复
(
0
)