Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (1.5k points)
Can anyone help me in writing a Python program to check if it is a Leap year or not?

1 Answer

0 votes
by (7.2k points)
# Python Program to Check Leap Year using Elif Statement

year = int(input("Please Enter the Year Number you wish: "))

if (year%400 == 0):
          print("%d is a Leap Year" %year)
elif (year%100 == 0):
          print("%d is Not the Leap Year" %year)
elif (year%4 == 0):
          print("%d is a Leap Year" %year)
else:
          print("%d is Not the Leap Year" %year)

Related questions

0 votes
1 answer
0 votes
1 answer
asked Feb 17, 2021 in Java by Harsh (1.5k points)
0 votes
2 answers

Browse Categories

...