Erik Max Francis:
>result = [sqrt(x**2 + y**2) for x, y in zip(xs, ys)]

Another possibility:

from math import hypot
result = [hypot(*xy) for xy in zip(xs, ys)]

Or better:
from math import hypot
result = map(hypot, xs, ys)

bearophile

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

Reply via email to