[Tutor] Find out if a number is even or not

Alan Gauld alan.gauld at freenet.co.uk
Tue Oct 19 05:48:20 CEST 2004


> Why these times are, on average, faster than they were before, I'm
not
> sure.

The actual times are never reliable in these tests its the comparison
that is important. The time can be influenced by other background
activity on the PC, how much RAM is free at any given moment etc...

> Still, the boolean type approach is the slowest. Perhaps there
> is some overhead in the creation of booleans?

It would seem so Bill. Very odd, I expected Python to have
cached True ad alse as it does with Numbers and so be quite fast.

Thanks for doing that bit of research, it all adds to the
collective pot :-)

Alan G.



More information about the Tutor mailing list