Python的UnboundLocalError: local variable 'xxx' referenced before assignment

  • http://blog.csdn.net/onlyanyz/article/details/45009697
n=0  
def func():  
    global n  
    print n  
    n+=1  
  
func()  
print n  

你可能感兴趣的:(Python的UnboundLocalError: local variable 'xxx' referenced before assignment)