[Tutor] NEWBIE- how to make a program continue

Kirby Urner urnerk@qwest.net
Wed, 20 Feb 2002 10:06:05 -0800


>
>But isn't this only true of the Gregorian calender?
>So Julian leap years are as per the original and
>Gregorian leaps as per your function - or is it
>the other way around?
>
>Alan g.

Ah so.  I was just thinking of "whatever calendar we're
actually using".  You're right though, it's the Gregorian
that has this new wrinkle (since around 1582) of messing
with the "once every four" rule.

So I should have changed the name of my function def.
One could have both functions in the module, and a
parameter (with a default) to control re which calendar
you're asking. E.g.:

     def isLeap(yr,julian=0):
         if julian:
            return isJulianLeap(yr)
         else:
            return isGregorianLeap(yr)

Include the above in a "get user input loop" if desired
(or just use it as is in the shell as is -- my preference).

Thanks for the edifying remarks.

Kirby