Example:
list1 = [0,1,2]
list2 = [0,1]
list3 = [0,1,2,3]
Then the permutations would be:
0,0,0
0,0,1
0,0,2
0,0,3
0,1,0
0,1,1
0,1,2
0,1,3
1,0,0
1,0,1
1,0,2
1,0,3
1,1,0
1,1,1
1,1,2
1,1,3
...and so on with 3 x 2 x 4 = 24 permutations.
The number of lists is not necessarily 3 (they can be any number, n) and the order matters so 0,0,1 is not the same as 0,1,0.
I understand I might have to use itertools somehow, but not sure how to approach this. I can't just make three nested loops since the number of lists varies.
This is a variation of this question, but the number of lists varies and order matters.
I appreciate any help or hint. Thanks.