Skip to content

Commit 912cf19

Browse files
authored
Leap year
1 parent abe588c commit 912cf19

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

leapYear.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
year = 2000
2+
3+
# To get year (integer input) from the user
4+
# year = int(input("Enter a year: "))
5+
6+
if (year % 4) == 0:
7+
if (year % 100) == 0:
8+
if (year % 400) == 0:
9+
print("{0} is a leap year".format(year))
10+
else:
11+
print("{0} is not a leap year".format(year))
12+
else:
13+
print("{0} is a leap year".format(year))
14+
else:
15+
print("{0} is not a leap year".format(year))

0 commit comments

Comments
 (0)