Home >>Python Programs >Python Program to Check Leap Year
In this example, we will see a Python program in which we can check if any given input year is a leap year or not. A year is called a leap year if that year has 366 days which means an additional day. This additional day is added in February month which makes it 29 days long. The leap year occurred once in every 4 years.
Example :
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))