I know I can do this with itertools, but I'm actually trying to learn how to start working with recursions.
I want to take the two values in this list...
[0, 1]
...and create a list of lists that contain it's permutations:
[ [0, 0], [0, 1], [1, 0], [1, 1] ]
I can do it with a comprehension and loops:
[ [i, j] for i in range(0, 2) for j in range(0, 2) ]
But that doesn't really scale well.
So if someone could help me understand how to do this with a recursive function that would scale to an arbitrary number of values in the original list I would appreciate it.
itertools.product
here: docs.python.org/2/library/itertools.html#itertools.product