I repost with a simplified question (my previous post was closed).
I need to output all combination of a list of length N
.
I already know that combinations
will do this with, as example, the actual input list: ['A, 'B']
==> output: ['A', 'A'], ['A', 'B'], ['B', 'B']
But I need this: ['A', 'A'], ['A', 'B'], ['B', 'A'], ['B', 'B']
.
Is there a way to do it with combinations()
?