from itertools import permutations
l = [0, 1, 2, 3, 4]
x = permutations (l, 3)
I get the following :
(0, 1, 2) , (0, 1, 3), ...., (0, 2, 1), (0, 2, 3), (0,2,4),...., (4, 3, 0), (4, 3, 1),
(4, 3, 2)
Which is what was expected. But what i need is :
(0, 0, 0), (0, 0, 1), ...., (0, 0, 4), (0, 1, 0), (0, 1, 1)........
How to achieve this ?