extracting numbers with decimal places from a string

Chris Angelico rosuav at gmail.com
Sun Jan 11 19:17:29 EST 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