Write a Python program that checks if a year entered by the user is a leap year or not. Print an appropriate message.
Example:
Input: 2000
Output: 2000 is a leap year
A leap year is exactly divisible by 4 except for century years (years ending with 00). The century year is a leap year only if it is perfectly divisible by 400.
year = int(input("Enter a year: "))
if year % 4 == 0:
if year % 100 == 0:
if year % 400 == 0:
print(f"{year} is a leap year.")
else:
print(f"{year} is not a leap year.")
else:
print(f"{year} is a leap year.")
else:
print(f"{year} is not a leap year.")
NOTEOwing to browser caching, any code input into the Trinket IDE might carry over across page refreshes or when transitioning between different questions. To commence with a clean slate, either click on the 'Reset Button' found within the IDE's Hamburger icon (☰) menu or resort to using Chrome's Incognito Mode.