<br><font size=2><tt>Hi Terry</tt></font>
<br>
<br><font size=2><tt>> "According to the Gregorian calendar, which
is the civil calendar in use<br>
> today, years evenly divisible by 4 are leap years, with the exception
of<br>
> centurial years that are not evenly divisible by 400."<br>
</tt></font>
<br><font size=2><tt>> def isLeapYear(y):<br>
> if y % 4 == 0: return True<br>
As it always return True, if y%4 == 0, there is problem with the exceptions</tt></font>
<br><font size=2><tt>> if (y % 4 == 0) and not (y %100 == 0):
return True<br>
> else: return False</tt></font>
<br>
<br>
<br><font size=2><tt>I feel that, the cleanest way to translate the definition
into Boolean logic</tt></font>
<br><font size=2><tt>is to do it backward instead of thinking on the exceptions.
</tt></font>
<br>
<br><font size=2><tt>def leap_year(year):</tt></font>
<br><font size=2><tt> if year%400 == 0: return True
# We said these years are always leap year</tt></font>
<br><font size=2><tt> if year%100 == 0: return False
# the exception handled already</tt></font>
<br><font size=2><tt> if year%4 == 0: return True
# no problem with the exceptions</tt></font>
<br><font size=2><tt> return False
# this it the default</tt></font>
<br>
<br>
<br><font size=2><tt>ps</tt></font>
<br><font size=2><tt>hungarians name format: family name, christian name</tt></font>
<br><font size=2><tt>hungarian date format: year/month/day</tt></font>
<br><font size=2><tt>Your logic is backward, and mine is the forward, isn't
it? ;)</tt></font>
<br>
<br>
<br><font size=2><tt>Janos</tt></font>