Table of Contents

Program to Check Leap Year in Python

1900 is a not leap year
2017 is not a leap year 2012 is a leap year 2000 is a leap year
# Python program to check if year is a leap year or not

print("Enter a year: ")
y = int(input())

if (y % 400 == 0) and (y % 100 == 0):
print("Leap year")

elif (y % 4 ==0) and (y % 100 != 0):
print("Leap year")

else:
print("Not a leap year")