Re: Leap year

2014-09-29 Thread Rustom Mody
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"

Re: Leap year

2014-09-27 Thread Steven D'Aprano
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

Re: Leap year

2014-09-26 Thread Gene Heskett
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:

Leap year

2014-09-26 Thread Seymore4Head
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