Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. >>> a = 255 # or another number from -5 to 256
  2. >>> b = 999 # or another number outside -5 to 256
  3. >>> a is 255
  4. True
  5. >>> b is 999
  6. False
  7.  
  8. $ python3.7 -VV
  9. Python 3.7.3 (default, Mar 26 2019, 01:59:45)
  10. [GCC 5.4.0 20160609]
  11.  
  12. Python 3.7.3 (default, Mar 26 2019, 01:59:45)
  13. [GCC 5.4.0 20160609] on linux
  14. Type "help", "copyright", "credits" or "license" for more information.
  15. >>> a = 255
  16. >>> b = 999
  17. >>> print("255:", a is 255)
  18. 255: True
  19. >>> print("999:", b is 999)
  20. 999: False
  21.  
  22. #!/usr/bin/env python3.7
  23. # -*- coding: utf-8 -*-
  24.  
  25. a = 255
  26. b = 999
  27. print("255:", a is 255)
  28. print("999:", b is 999)
  29.  
  30. $ python3.7 test.py
  31. 255: True
  32. 999: True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement