> Yes, just about any ‘map()’ operation has a corresponding list
> comprehension. (Does anyone know of a counter-example, a ‘map()’
> operation that doesn't have a correspondingly simple list
> comprehension?)

Try turning this into a list comprehension:

  vectorsum = lambda *args: map(sum, zip(*args))

  vectorsum([1,2], [3,4], [5,6])
->[9, 12]
  vectorsum([1,2], [3,4], [5,6], [7,8])
->[16, 20]

Peace,

----aht
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to