我正在
local variable 'flag' referenced before assignment
在python中。我在这里错了吗?
flag = 0
def abc():
while flag <= 10:
try:
print(10/0)
except Exception:
print('yo')
flag += 1
abc()
flag = 0
def abc(argument):
while argument <= 10:
try:
print(10/0)
except Exception:
print('yo')
argument += 1
abc(flag)
def abc():
flag = 0
while flag <= 10:
try:
print(10/0)
except Exception:
print('yo')
flag += 1
abc(flag)
我会用这个。