exercism.org/python/leap/leap.py

10 lines
226 B
Python
Raw Normal View History

2024-03-25 10:14:17 +01:00
def leap_year(year):
2024-03-25 10:27:39 +01:00
hundred_special = year % 100 == 0
if year % 4 == 0 and not hundred_special:
return True
if year % 4 == 0 and hundred_special and year % 400 == 0:
return True
return False