pairwise combination of two lists

SigmundV sigmundv at gmail.com
Thu Aug 18 17:51:13 EDT 2011


On Aug 17, 9:22 pm, Yingjie Lin <Yingjie.... at mssm.edu> wrote:
> I found zip() but it only gives [('a', '1'), ('b', '2')],  not exactly what I am looking for.

Yet, if you feed the zip into a list comprehension you get what you
want:

li3 = [''.join(l) for l in zip(li1,li2)]


Sigmund



More information about the Python-list mailing list