python - Combine lists by joining strings with matching index values -


i have 2 lists combine, instead of increasing number of items in list, i'd join items have matching index. example:

list1 = ['a', 'b', 'c'] list2 = ['1', '2', '3'] list3 = ['a1', 'b2', 'c3'] 

i've seen quite few other questions combining 2 lists, i'm afraid haven't found achieve.

any appreciated. cheers.

>>> list1 = ['a', 'b', 'c'] >>> list2 = ['1', '2', '3'] >>> map(lambda a, b: + b, list1, list2) ['a1', 'b2', 'c3'] 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -