[Tutor] "if n % 2 == 0" vs. "if not n % 2" compared for speed: aesthetics lose

Emile van Sebille emile at fenx.com
Tue Nov 23 23:33:50 CET 2010


On 11/23/2010 1:26 PM Richard D. Moores said...
> So what's the connection with the tests I've run?

It's an even/odd test.

[ii&1 for ii in range(1,1000,2)]
[ii&1 for ii in range(0,1000,2)]

Emile



More information about the Tutor mailing list