map and operator.add usage

Fernando Rodríguez spamers at must.die
Mon Jan 29 15:36:45 EST 2001


Hi!

In Lisp I can do:

CL-USER 9 > (mapcar #'+ '(1 2) '(3 4) '(5 6))
(9 12)

but how can I do it in Python?

I tried: map(operator.add, [1, 2], [3, 4], [5, 6]) but Python complains that
operator.add need 2 operands... What's the easy way to do this in Python??
O:-)





//-----------------------------------------------
//	Fernando Rodriguez Romero
//
//	frr at mindless dot com
//------------------------------------------------



More information about the Python-list mailing list