Skip to content

Instantly share code, notes, and snippets.

@MetroWind
Created March 2, 2016 16:55
Show Gist options
  • Save MetroWind/a455e6f1326a2df0f32e to your computer and use it in GitHub Desktop.
Save MetroWind/a455e6f1326a2df0f32e to your computer and use it in GitHub Desktop.
Iterator over a set while removing elements #python
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