See itertools.permutations (python standard library)e.g.In [3]: list(itertools.permutations([1,1,0,0]))Out[3]:[(1, 1, 0, 0),(1, 1, 0, 0),(1, 0, 1, 0),(1, 0, 0, 1),(1, 0, 1, 0),(1, 0, 0, 1),(1, 1, 0, 0),(1, 1, 0, 0),(1, 0, 1, 0),(1, 0, 0, 1),(1, 0, 1, 0),(1, 0, 0, 1),(0, 1, 1, 0),(0, 1, 0, 1),(0, 1, 1, 0),(0, 1, 0, 1),(0, 0, 1, 1),(0, 0, 1, 1),(0, 1, 1, 0),(0, 1, 0, 1),(0, 1, 1, 0),(0, 1, 0, 1),(0, 0, 1, 1),(0, 0, 1, 1)]Hope that helps,-Joe