<br><font size=2><tt>Hi Terry</tt></font>
<br>
<br><font size=2><tt>&gt; &quot;According to the Gregorian calendar, which
is the civil calendar in use<br>
&gt; today, years evenly divisible by 4 are leap years, with the exception
of<br>
&gt; centurial years that are not evenly divisible by 400.&quot;<br>
</tt></font>
<br><font size=2><tt>&gt; def isLeapYear(y):<br>
&gt; &nbsp; 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>&gt; &nbsp; if (y % 4 == 0) and not (y %100 == 0):
return True<br>
&gt; &nbsp; 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>&nbsp; &nbsp; if year%400 == 0: return True &nbsp;
&nbsp;# We said these years are always leap year</tt></font>
<br><font size=2><tt>&nbsp; &nbsp; if year%100 == 0: return False &nbsp;
# the exception handled already</tt></font>
<br><font size=2><tt>&nbsp; &nbsp; if year%4 &nbsp; == 0: return True &nbsp;
&nbsp;# no problem with the exceptions</tt></font>
<br><font size=2><tt>&nbsp; &nbsp; return False &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # 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? &nbsp;;)</tt></font>
<br>
<br>
<br><font size=2><tt>Janos</tt></font>