Return to Snippet

Revision: 26448
at April 28, 2010 19:43 by iamok


Initial Code
summed = [sum(pair) for pair in zip(listA, listB)]

or

from operator import add 
summed = map(add,listA,listB) 

or

summed = map(sum,zip(listA,listB))

Initial URL

                                

Initial Description

                                

Initial Title
adding elements of two lists

Initial Tags
python

Initial Language
Python