Skip to content

Commit

Permalink
Create to check leap year
Browse files Browse the repository at this point in the history
  • Loading branch information
jainabpatel555 authored Oct 5, 2020
1 parent ebfd55d commit f14007a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions to check leap year
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Python program to check if year is a leap year or not

year = 2000

# To get year (integer input) from the user
# year = int(input("Enter a year: "))

if (year % 4) == 0:
if (year % 100) == 0:
if (year % 400) == 0:
print("{0} is a leap year".format(year))
else:
print("{0} is not a leap year".format(year))
else:
print("{0} is a leap year".format(year))
else:
print("{0} is not a leap year".format(year))

0 comments on commit f14007a

Please sign in to comment.