I want to be able to produce all possible permutations of an array of n elements, where each one of the n elements can take specific discrete values.
For example, lets say I want to create all possible (27) permutations of an array of 3 numbers, where:
The first number can be either 1,3 or 4 The second number can be either 0,2 or 3 The third number can be either 1,2 or 5
The answer will be (1,0,1) (1,2,1) (3,0,1) (3,2,1) (3,2,2) ... etc
Is anybody kind enough to tell me how to do this in Python? What I want is to provide as inputs the possible choices for each number and then the algorithm will produce all possible permutations