Created
June 15, 2020 05:36
-
-
Save toniesteves/2c134f64854df41826d1be0120f2ea1f 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
from itertools import chain, combinations | |
authors = ['Andrew Ng', 'François Chollet', 'Josh Stamer', 'Kent Beck', 'Erick Evans', 'Soumith Chintala']; | |
def subsets(iterable): | |
s = list(iterable) | |
return chain.from_iterable(combinations(s, r) for r in range(len(s)+1)) | |
print(list(subsets(authors))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment