Guest User

Untitled

a guest
Aug 19th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. # b is first defined inside a trivially true if statement
  2. In [6]: if True:
  3. ...: b = 21
  4. ...:
  5. # b is still defined globally
  6. In [7]: b
  7. Out[7]: 21
  8.  
  9. # it does matter that the if statement is evaluated
  10. In [10]: if False:
  11. ....: b = 1337
  12. ....:
  13. In [11]: b
  14. Out[11]: 21
Add Comment
Please, Sign In to add comment