Advertisement
Guest User

Untitled

a guest
Oct 28th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. while someCondition:
  2. alpha = True # alpha declared in while's scope
  3. for x in range(1, limit):
  4. if someOtherCondition:
  5. alpha = False # alpha modified in inner scope
  6. break
  7. if alpha: # I expect this alpha to refer to modified value from inner scope but it's always showing True
  8. doSomething(z)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement