Advertisements
Advertisements
Question
Write a program to check if the year entered by the user is a leap year or not.
Short/Brief Note
Advertisements
Solution
The year is a leap year if it is divisible by 4.
Program:
year = int(input("Enter the year: "))
if(year % 4 == 0):
print("The year",year," is a leap year.")
else:
print("The year",year," is not a leap year.")
OUTPUT:
Enter the year: 2020
The year 2020 is a leap year.shaalaa.com
Is there an error in this question or solution?
