all possible matchings of elements of two lists
zuo at chopin.edu.pl
Wed Aug 26 23:02:42 CEST 2009
26-08-2009 o 12:05:41 Sandy <dksreddy at gmail.com> wrote:
> Hi all,
> I basically want all possible matchings of elements from two lists,
> Ex: [1,2] [a,b,c]
> [ [(1,a),(2,b)]
> My thought is to get all possible permutations of two lists given and
> select any combination and use zip to get the tuples. Repeat this for
> all possible combinations.
> Any other ideas?
See: module itertools -- there are (OOTB) some combinatoric generators
that may be useful for you.
Jan Kaliszewski (zuo) <zuo at chopin.edu.pl>
More information about the Python-list