Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
9
Task/Power-set/Python/power-set-2.py
Normal file
9
Task/Power-set/Python/power-set-2.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
def powersetlist(s):
|
||||
r = [[]]
|
||||
for e in s:
|
||||
print "r: %-55r e: %r" % (r,e)
|
||||
r += [x+[e] for x in r]
|
||||
return r
|
||||
|
||||
s= [0,1,2,3]
|
||||
print "\npowersetlist(%r) =\n %r" % (s, powersetlist(s))
|
||||
Loading…
Add table
Add a link
Reference in a new issue