Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6510b17

Browse files
added program to check leap year👩‍💻
1 parent 946b17f commit 6510b17

File tree

1 file changed

+17
-0
lines changed

1 file changed

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

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /