Solve python/exercises/leap

This commit is contained in:
Daniel Siepmann 2024-03-25 10:27:39 +01:00
parent 2ee1856d7f
commit eb80f955d7
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4

View file

@ -1,2 +1,9 @@
def leap_year(year):
pass
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