Skip to content

Commit ab6480b

Browse files
solves write a function
1 parent c4ee2fe commit ab6480b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

introduction/WriteAFunction.py

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# https://www.hackerrank.com/challenges/write-a-function/problem
2+
3+
4+
def is_leap(year):
5+
if (year % 4 == 0):
6+
if (year % 400 == 0):
7+
return True
8+
if (year % 100 == 0):
9+
return False
10+
return True
11+
return False
12+
13+
year = int(input())
14+
print(is_leap(year))

0 commit comments

Comments
 (0)