[Tutor] [Fwd: Re: n.isalnum() is failing]]

Alan Gauld alan.gauld at btinternet.com
Tue Jul 3 23:41:27 CEST 2007


"Terry" <terry.kemmerer at gmail.com> wrote 

> I was using the  "t1 == int(t1)" type compare, that I 
> learned in BASIC about  25 years ago, to discover 
> a remainder or no.

What a pity. Even the most elementary BASIC has 
always had the MOD operator for finding remainders.
and a \ operator for integer division. Thus in GW BASIC 
(from around 1981)

PRINT 10\3 -> 3
PRINT 10 MOD 3 -> 1

> that works....but the day is young. And maybe "%" is faster?

Probably, but not by enough that you'll notice unless you 
are testing a few centuries worth of dates!

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld



More information about the Tutor mailing list