I have a python list as below
l = ['water', 'park', 'kit']
To get all combinations of these elements, I'm using this
p = list(itertools.permutations(l))
For which I get result as below:
[('water', 'park', 'kit'), ('water', 'kit', 'park'), ('park', 'water', 'kit'), ('park', 'kit', 'water'), ('kit', 'water', 'park'), ('kit', 'park', 'water')]
I also need partial combinations of the elements as well, something like below:
[('water'), ('water', 'kit'), ('park',), ('park', 'kit'), ('kit', 'park')]
Is there a way to populate these combinations as well?