Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. >>> a = 3
  2. >>> def foo():
  3. ...     print a
  4. ...     a = 4
  5. ...
  6. >>> foo()
  7. Traceback (most recent call last):
  8.   File "<stdin>", line 1, in <module>
  9.   File "<stdin>", line 2, in foo
  10. UnboundLocalError: local variable 'a' referenced before assignment
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement