Given a list l
:
l = ['A', 'B', 'C']
How can I write a function that returns all possible unique combinations of n
members, in a list of lists? Order doesn't matter for uniqueness. The outputs in this example would be (the order is also unimportant in the output):
my_function(list=l, n=1)
[['A'], ['B'], ['C']]
my_function(list=l, n=2)
[['A', 'B'], ['A', 'C'], ['B', 'C']]
my_function(list=l, n=3)
[['A', 'B', 'C']]