extracting numbers with decimal places from a string

Chris Angelico rosuav at gmail.com
Mon Jan 12 01:17:29 CET 2015


On Mon, Jan 12, 2015 at 11:09 AM, Peter Otten <__peter__ at web.de> wrote:
>>
>>   print(sum(map(lambda x: float(x), s.split(',')))
>>
>> Please trim your quotes to the relevant minimum.
>
> Hm, can you explain what this
>
> lambda x: float(x)
>
> is supposed to achieve? I mean other than to confuse a newbie...

Maybe he gets paid by the character.

ChrisA



More information about the Python-list mailing list