John Machin wrote:
> Michael Press wrote:
>> I have not written python codes nor run any. I saw this
>> code posted and decided to try it. It fails. I read the
>> tutorial and the entry for the built in function sum,
>> but still do not see the problem. The code was cut and
>> paste.
>
> I doubt
Bjoern Schliessmann wrote:
> Are generator comprehensions and generator expressions the same?
the documentation uses the word "expression", not comprehension.
--
http://mail.python.org/mailman/listinfo/python-list
Paul Rubin wrote:
> Generator comprehensions
Are generator comprehensions and generator expressions the same?
Regards,
Björn
--
BOFH excuse #35:
working as designed
--
http://mail.python.org/mailman/listinfo/python-list
[Matt Moriarity]
>> try surrounding your sum argument in brackets:
>>
>> sum([phi(x // ps[i+1], i) for i in range(a)])
>>
>> instead of:
>>
>> sum(phi(x // ps[i+1], i) for i in range(a))
[Michael Press]
> Thank you. That makes it work.
But is a wrong solution ;-) As others have suggested, it's a
In article
<[EMAIL PROTECTED]>
,
"Matt Moriarity" <[EMAIL PROTECTED]> wrote:
> try surrounding your sum argument in brackets:
>
> sum([phi(x // ps[i+1], i) for i in range(a)])
>
> instead of:
>
> sum(phi(x // ps[i+1], i) for i in range(a))
Thank you. That makes it work.
--
Michael Press
--
Michael Press wrote:
> I have not written python codes nor run any. I saw this
> code posted and decided to try it. It fails. I read the
> tutorial and the entry for the built in function sum,
> but still do not see the problem. The code was cut and
> paste.
I doubt it -- "none" should be "None"
Michael Press <[EMAIL PROTECTED]> writes:
> File "/Users/mdp/source/prime_counter_python", line 6
> return x - sum(phi(x // ps[i+1], i) for i in range(a))
> ^
> SyntaxError: invalid syntax
>
> Here are some lines from python -v:
>
> Python 2.3 (#1,
try surrounding your sum argument in brackets:
sum([phi(x // ps[i+1], i) for i in range(a)])
instead of:
sum(phi(x // ps[i+1], i) for i in range(a))
On Nov 18, 5:23 pm, Michael Press <[EMAIL PROTECTED]> wrote:
> I have not written python codes nor run any. I saw this
> code posted and decided t
Michael Press wrote:
> I have not written python codes nor run any. I saw this
> code posted and decided to try it. It fails. I read the
> tutorial and the entry for the built in function sum,
> but still do not see the problem. The code was cut and
> paste. Please help. Thanks.
>
> ___
I have not written python codes nor run any. I saw this
code posted and decided to try it. It fails. I read the
tutorial and the entry for the built in function sum,
but still do not see the problem. The code was cut and
paste. Please help. Thanks.
_BEGIN_CODE__
10 matches
Mail list logo