On Sun, 07 Apr 2013 04:16:27 -0700, ReviewBoard User wrote:
> Hi
> I am a newbie to python and am trying to write a program that does a sum
> of squares of numbers whose squares are odd. For example, for x from 1
> to 100, it generates 165 as an output (sum of 1,9,25,49,81)
>
> Here is the code I
> I can't even read that mess... three nested lambda?
I have to say this and other answers in this thread seem not that friendly to
me.
The OP said it's a newbie question, we should be more welcoming to newcomers.
--
http://mail.python.org/mailman/listinfo/python-list
On 7 April 2013 20:23, Ian Foote 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__, m
On 07/04/13 20:09, Dennis Lee Bieber wrote:
On Sun, 7 Apr 2013 04:16:27 -0700 (PDT), ReviewBoard User
declaimed the following in
gmane.comp.python.general:
Hi
I am a newbie to python and am trying to write a program that does a
sum of squares of numbers whose squares are odd.
For example, for
On Apr 7, 4:16 pm, ReviewBoard User
wrote:
> Hi
> I am a newbie to python and am trying to write a program that does a
> sum of squares of numbers whose squares are odd.
> For example, for x from 1 to 100, it generates 165 as an output (sum
> of 1,9,25,49,81)
>
> Here is the code I have
> print re
> I am a newbie to python
Welcome! I hope you'll do great things with Python.
> and am trying to write a program that does a
> sum of squares of numbers whose squares are odd.
OK.
> For example, for x from 1 to 100, it generates 165 as an output (sum
> of 1,9,25,49,81)
I don't follow, you seem to
On 04/07/2013 07:16 AM, ReviewBoard User wrote:
Hi
I am a newbie to python
Then why are you trying to do 7 or 8 things on one line?
and am trying to write a program that does a
sum of squares of numbers whose squares are odd.
For example, for x from 1 to 100, it generates 165 as an output (su
On Sunday, April 7, 2013 9:16:27 PM UTC+10, ReviewBoard User wrote:
> Hi
>
> I am a newbie to python and am trying to write a program that does a
>
> sum of squares of numbers whose squares are odd.
>
> For example, for x from 1 to 100, it generates 165 as an output (sum
>
> of 1,9,25,49,81)
>
Hi
I am a newbie to python and am trying to write a program that does a
sum of squares of numbers whose squares are odd.
For example, for x from 1 to 100, it generates 165 as an output (sum
of 1,9,25,49,81)
Here is the code I have
print reduce(lambda x, y: x+y, filter(lambda x: x%2, map(lambda x: