write a program in python to take year as input and check if it is a leap year or not.
Answers
Answered by
18
Year=int (input("Enter year to be checked:"))
if(Year%4==0 and Year%100!=0 or Year%400==0):
print("The Year is a leap year!")
else:
print("The Year isn't a leap year!")
Answered by
2
Answer:
# Python program to check if year is a leap year or not
year = 2000
# To get year (integer input) from the user
# 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))
Hope this helps you....⇔
Similar questions
Math,
7 months ago
Social Sciences,
7 months ago
English,
7 months ago
English,
1 year ago
Science,
1 year ago