Skip to content

Instantly share code, notes, and snippets.

@Budincsevity
Created September 8, 2017 12:32
Show Gist options
  • Save Budincsevity/a061aea30cc01496f30bed333fb639b7 to your computer and use it in GitHub Desktop.
Save Budincsevity/a061aea30cc01496f30bed333fb639b7 to your computer and use it in GitHub Desktop.
Combinations of list items
import itertools
stuff = ['a', 'b', 'c']
for L in range(0, len(stuff)+1):
for subset in itertools.combinations(stuff, L):
print(subset)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment