newbie - concatanating 2 lists

Gillou glenfant at equod.com.nospam
Wed Feb 21 12:47:36 EST 2001


This works with Python 1.5.2 and should with any other

>>> li1 = ['a', 'b', 'c']
>>> li2 = ['x', 'y', 'z']
>>> l3 = map(lambda s1,S2:s1+s2, li1, li2)
>>> l3
['ax', 'by', 'cz']

You're welcome

"Gnanasekaran Thoppae" <gnana at mips.biochem.mpg.de> a écrit dans le message
news: mailman.982775239.14135.python-list at python.org...
> hi,
>
> i am just beginning to use python.
>
> i have:
>
> li1 = ['a', 'b', 'c']
> li2 = ['x', 'y', 'z']
>
> i want:
>
> li3 = ['ax', 'by', 'cz']
>
> how do i do it?
>
> thanks
>
> -gnana
>
>




More information about the Python-list mailing list