newbie - concatanating 2 lists

Remco Gerlich scarblac at pino.selwerd.nl
Thu Feb 22 15:32:04 EST 2001


Steve Purcell <stephen_purcell at yahoo.com> wrote in comp.lang.python:
> Hang on, it *is* still the shortest way in Python 2:
> 
>         li3 = [a+b for a,b in zip(li1,li2)]
>         li3 = map(lambda a,b:a+b,li1,li2)

          li3 = map(''.join,zip(li1,li2))
(as mentioned before)

Is two strokes smaller.

That's just my luck. First time I ever win at Perl Golf, it's in Python...

-- 
Remco Gerlich



More information about the Python-list mailing list