[Tutor] A fun puzzle

Ken Oliver ksterling at mindspring.com
Fri Aug 24 22:46:54 CEST 2007



-----Original Message-----
>From: Dick Moores <rdm at rcblue.com>
>Sent: Aug 24, 2007 4:30 PM
>To: Python Tutor List <tutor at python.org>
>Subject: Re: [Tutor] A fun puzzle
>
>Dick Moores wrote:
>>At 10:22 AM 8/24/2007, Kent Johnson wrote:
>>>So you actually pasted that code into timeit.py?
>>Yeah. :-( I think I learned on the Tutor list to do it that way, but 
>>I'm not sure. Thanks for showing me a correct way.
>
>I hope not!
>
>>>Using timeit more conventionally I get unsurprising results. This 
>>>program has output:
>>>0.497083902359
>>>0.359513998032
>>>
>>>which is more in line with what I would expect.
>>Using your exact code, I just got
>>0.737564690484
>>1.17399585702
>>Which is the reverse of your result, but on a slower computer. 
>>What's up with that??
>
>
>Kent,
>
>That result was gotten using Ulipad. Thought I'd try it at my command 
>line (several times, of course--I've reported what seemed to be 
>representative data).
>
>Using command line:
>0.673447044247
>0.511676204657
>
>Using IDLE:
>0.845213567646
>0.685519807685
>
>Using Wing Pro (executing with Alt+F5)
>0.940486290855
>0.998467123615
>
>Is it possible that the timeit module should be used only at the command line?
>
>Dick

The IDLE numbers match those on my machine to within 0.001.  For what it is worth.


More information about the Tutor mailing list