-
-
Save MetroWind/a455e6f1326a2df0f32e to your computer and use it in GitHub Desktop.
Iterator over a set while removing elements #python
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
myset = set([3,4,5,6,2]) | |
while myset: | |
myset.pop() | |
print myset |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment