On May 31, 3:04 pm, Vincent Davis <vinc...@vincentdavis.net> wrote: > For example If I want all possible ordered lists of 0,1 of length 3 > (0,0,0) > (0,0,1) > (0,1,1) > (1,1,1) > (1,0,1) > (1,1,0) > (1,0,0) > I don't see a way to get this directly from the itertools. But maybe I > am missing something.
In this case, you're missing itertools.product: >>> list(itertools.product([0, 1], repeat=3)) [(0, 0, 0), (0, 0, 1), (0, 1, 0), (0, 1, 1), (1, 0, 0), (1, 0, 1), (1, 1, 0), (1, 1, 1)] -- Mark -- http://mail.python.org/mailman/listinfo/python-list