programming-examples/python/Date/Python program to determine whether a given year is a leap year.py

11 lines
248 B
Python
Raw Normal View History

2019-11-15 12:59:38 +01:00
def leap_year(y):
if y % 400 == 0:
return True
if y % 100 == 0:
return False
if y % 4 == 0:
return True
else:
return False
print(leap_year(1900))
print(leap_year(2004))