f=1
def skip(i):
global f +=i
return
怎么了?
我不知道
>>> f
1
>>> skip(3)
Traceback (most recent call last):
File "<pyshell#10>", line 1, in <module>
skip(3)
File "C:/Users/PC/Desktop/game.py", line 4, in skip
f +=i
UnboundLocalError: local variable 'f' referenced before assignment