Newbie to python. Very newbie question

Arnaud Delobelle arnodel at gmail.com
Sun Apr 7 16:16:34 EDT 2013


On 7 April 2013 20:23, Ian Foote <ian at feete.org> wrote:
> I'm surprised no one has suggested:
>
>>>> import math
>>>> sum( x*x for x in range(1, int(math.sqrt(100)), 2))

Yeah! And I'm surprised no one came up with:

>>> from itertools import count, takewhile
>>> sum(takewhile((100).__gt__, filter((2).__rmod__, map((2).__rpow__, count(1)))))
165

:)

-- 
Arnaud



More information about the Python-list mailing list