syntax error in sum(). Please explicate.

Michael Press jack at abc.net
Sun Nov 19 00:36:46 CET 2006


In article 
<1163889196.135008.126970 at h54g2000cwb.googlegroups.com>
,
 "Matt Moriarity" <matt.moriarity at gmail.com> 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



More information about the Python-list mailing list