Program to check leap year in python.

Program:-

 year=int(input("Enter year"))
if year%100==0:
if year%400==0:
print("Leap year")
else:
print("NOT a leap year")
elif year%4==0:
print("Leap year")
else:
print("NOT a leap year")

Output:-
D:PycharmProjectspythonProject1venvScriptspython.exe D:/PycharmProjects/pythonProject1/leep.py
Enter year1600
Leap year

Process finished with exit code 0

Leave a Reply

Your email address will not be published.