I am trying to print all the possible enumerations of a list for three variables. For example if my input is:
x = 1
y = 1
z = 1
I want the output to be like:
[[0, 0, 0], [0, 0, 1], [0, 1, 0], [1, 0, 0], [1, 1, 0], [1, 0, 1], [0, 1, 1], [1, 1, 1]]
If any of the x,y,z variables are higher than 1, it would enumerate all the integers from 0 to the variable value. For example, if x=3 then 0, 1, 2, or 3 would be possible in the first slot of the 3-element lists.
Right now I am creating the list comprehension like this:
output = [ [x,y,z] for x,y,z in range(x,y,z)]
I think something is wrong with the range function?