0 votes
196 views
in Python by (98.9k points)
edited
Write a program that prompts the user to input a year and determine whether the year is a leap year or not

1 Answer

0 votes
by (98.9k points)
selected by
 
Best answer
#program to determine leap year
yr= int(input("Enter year to determine the is it leap or not"))

if (yr%4 == 0 ) or (yr%100 != 0 and yr%400 == 0) :

 print("The year is a leap year!")
else:
 print("The year isn't a leap year!")

Related questions

0 votes
1 answer 149 views
asked Jul 20, 2022 in C programming by Doubtly (98.9k points)
0 votes
1 answer 126 views
0 votes
0 answers 74 views

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

561 users

...