pairwise combination of two lists

Luis M. González luismgz at gmail.com
Thu Aug 18 01:27:43 CEST 2011


This is the easiest and most pythonic way (IMHO):

>>>> l3 = [i+e for i in li1 for e in li2]
>>>> l3
['a1', 'a2', 'b1', 'b2']

Regards,
Luis



More information about the Python-list mailing list