我想弄清楚这个:
c = 1 def f(n): print c + n def g(n): c = c + n f(1) # => 2 g(1) # => UnboundLocalError: local variable 'c' referenced before assignment
谢谢!
python scope
python ×1
scope ×1