wer:
> def is_leap_year(year):
> return ((year % 4) == 0 and ((year % 100) != 0 or (year % 400) == 0))
> I didn't have any problem when I did this:
> if year % 400 == 0:
> print ("Not leap year")
> elif year % 100 == 0:
> print ("Leap year"
which are divisible by 4
(year % 4 == 0)
# and not divisible by 100
and (year % 100 != 0)
# unless divisible by 400
or (year % 400 == 0)
)
> I didn't have any problem when I did this:
>
> if year % 400 == 0:
> print ("Not
em I have the answer:
> def is_leap_year(year):
> return ((year % 4) == 0 and ((year % 100) != 0 or (year % 400) == 0))
>
> I didn't have any problem when I did this:
>
> if year % 400 == 0:
> print ("Not leap year")
> elif year % 100 == 0:
hen I did this:
if year % 400 == 0:
print ("Not leap year")
elif year % 100 == 0:
print ("Leap year")
elif year % 4 == 0:
print ("Leap year")
else:
print ("Not leap year")
--
https://mail.python.org/mailman/listinfo/python-list