Solve python/exercises/leap
This commit is contained in:
parent
2ee1856d7f
commit
eb80f955d7
1 changed files with 8 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue