Last active
February 9, 2020 13:00
-
-
Save tritium21/45b67d4d8b4703472d245cc714ad6469 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
magicians = "penn teller copperfield".split() | |
for magicians in magicians: | |
print(magicians) | |
# IS THE SAME AS | |
magicians = "penn teller copperfield".split() | |
_magicians_it = iter(magicians) # never enters the namespace | |
while True: | |
try: | |
magicians = next(_magicians_it) | |
print(magicians) | |
except StopIteration: | |
break | |
del _magicians_it # but uh, it never entered the namespace |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment