Skip to content

Instantly share code, notes, and snippets.

@kwekuboateng
Last active October 13, 2016 22:57
Show Gist options
  • Save kwekuboateng/062ee78d8a464646b878b80c9a9489d2 to your computer and use it in GitHub Desktop.
Save kwekuboateng/062ee78d8a464646b878b80c9a9489d2 to your computer and use it in GitHub Desktop.
def Subsets(sets):
x = [[]]
for i in sets:
for j in x:
x = x + [j + [i]]
return x
a = [1,2,5,6]
print(Subsets(a))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment