Generating all combinations

Scott David Daniels Scott.Daniels at Acm.Org
Sun May 31 22:39:39 CEST 2009


Johannes Bauer wrote:
> Hello group,
> 
> I'm trying to write a function in Python which does the following: For a
> number of arguments which are all lists, return a list (or generator)
> which yields all tuples of combination. E.g:

Look here:
   http://docs.python.org/library/itertools.html#itertools.product

(new in 2.6, but code works in lower versions).

--Scott David Daniels
Scott.Daniels at Acm.Org





More information about the Python-list mailing list