Guest User

Untitled

a guest
Sep 25th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. >>> class A:
  2. ... SOME_CONSTANT = 8
  3. ... print(str(SOME_CONSTANT))
  4. ...
  5. 8
  6. >>> class A:
  7. ... SOME_CONSTANT = 8
  8. ... def go(self):
  9. ... print(str(SOME_CONSTANT))
  10. ...
  11. >>> a = A()
  12. >>> a.go()
  13. Traceback (most recent call last):
  14. File "<stdin>", line 1, in <module>
  15. File "<stdin>", line 4, in go
  16. NameError: global name 'SOME_CONSTANT' is not defined
  17. >>>
Add Comment
Please, Sign In to add comment