List of strings to list of floats ?

Madhusudan Singh spammers-go-here at spam.invalid
Mon Oct 17 22:43:19 CEST 2005


Erik Max Francis wrote:

> 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)]
> 

Works perfectly. Thanks !



More information about the Python-list mailing list