0

While making an app I tried to think in a way to collect all the possible orders and combinations of an unknown length list in python. As an example, I have a list

[1, 2]

I want a way to make as an example list like this

[[1, 1, 1], [1, 1, 2], [1, 2, 1], [1, 2, 2], [2, 1, 1], [2, 1, 2], [2, 2, 1] [2, 2, 2]]

Yes I want a a bigger combination of list with all possible order and all with the same length as the example above

I was trying to find a way to do that but almost all of my ways ends in time run error So it would be helpful if anyone could help me and thanks

0 Answers0