RosettaCodeData/Task/Power-set/Python/power-set-4.py
2023-07-01 13:44:08 -04:00

3 lines
89 B
Python

def p(l):
if not l: return [[]]
return p(l[1:]) + [[l[0]] + x for x in p(l[1:])]