How can I speed up a script that iterates over a large range (600 billion)?

Benjamin Kaplan benjamin.kaplan at case.edu
Tue Jun 21 23:07:14 EDT 2011


On Tue, Jun 21, 2011 at 4:30 PM, Terry Reedy <tjreedy at udel.edu> wrote:
> On 6/21/2011 3:48 PM, John Salerno wrote:
>
>> Absolutely not! Each problem has been designed according to a "one-
>> minute rule", which means that although it may take several hours to
>> design a successful algorithm with more difficult problems, an
>> efficient implementation will allow a solution to be obtained on a
>> modestly powered computer in less than one minute."
>
> That statement is for C, not Python. Python is efficient with human time,
> but not machine time. If something really takes a minute in C, allow
> yourself at least 10 minutes or even more with plain CPython.
>
> --
> Terry Jan Reedy

Python is the second most popular language on Project Euler, at 14358
users compared to 15897 who use C/C++. I'm pretty sure they don't
assume you use C. Although Python's longs do make some of the early
problems really really easy.



More information about the Python-list mailing list