cannot access local variable where it is not associated with a value

papering發表於2024-07-26

cannot access local variable where it is not associated with a value

a=1
def f():
a+=1
f()

UnboundLocalError: cannot access local variable 'a' where it is not associated with a value

相關文章