Skip to content

Commit 23ef245

Browse files
Merge pull request seeditsolution#324 from sakshamsinghal011/patch-1
check leap year
2 parents be1d3f0 + b1607fb commit 23ef245

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

leap year

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
def checkYear(year):
2+
if (year % 4) == 0:
3+
if (year % 100) == 0:
4+
if (year % 400) == 0:
5+
return True
6+
else:
7+
return False
8+
else:
9+
return True
10+
else:
11+
return False
12+
13+
# Driver Code
14+
year = 2000
15+
if(checkYear(year)):
16+
print("Leap Year")
17+
else:
18+
print("Not a Leap Year")

0 commit comments

Comments
 (0)