List of strings to list of floats ?

Erik Max Francis max at alcyone.com
Mon Oct 17 16:05:30 EDT 2005


Madhusudan Singh wrote:

> Thanks. Now, a slightly more complicated question.
> 
> Say I have two lists of floats. And I wish to generate a list of floats that
> is a user defined function of the two lists.

	result = [sqrt(x**2 + y**2) for x, y in zip(xs, ys)]

-- 
Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
   Did you ever love somebody / Did you ever really care
   -- Cassandra Wilson



More information about the Python-list mailing list