MCPcopy Create free account
hub / github.com/Avisikta-Majumdar/HackerRank_Python_Solutions / is_leap

Function is_leap

Write a function.py:1–12  ·  view source on GitHub ↗
(year)

Source from the content-addressed store, hash-verified

1def is_leap(year):
2 leap = False
3 if (year % 4) == 0:
4 if (year % 100) == 0:
5 if (year % 400) == 0:
6 return True
7 else:
8 return leap
9 else:
10 return True
11 else:
12 return leap
13
14year = int(input())
15print(is_leap(year))

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected