Python 3.7.4:
The current calendar, called the Gregorian calendar, was introduced in 1582. Every year divisible by four was created to be a leap year, with the exception of the years ending in 00 (that is, those divisible by 100) and not divisible by 400. For instance, the years 1600 and 2000 are leap years, but 1700, 1800, and 1900 are not. Write a
Below was marked incorrect for me. I need to put it in a while loop. Also, I'm curious if there is a way to do it without def? Thank you!
----------------------
def leap(year):
if(year % 400 == 0):
return True
elif year % 100 == 0:
return False
elif year%4 == 0:
return True
else:
return False
def main():
year = int(input("Enter year: "))
if(leap(year)):
print(year,"is a leap year")
else:
print(year, "is not a leap year")
-----------------------
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images
- Solve this using JavaScriptarrow_forwardn this lab, you complete a prewritten Python program for a carpenter who creates personalized house signs. The program is supposed to compute the price of any sign a customer orders, based on the following facts: The charge for all signs is a minimum of $35.00. The first five letters or numbers are included in the minimum charge; there is a $4 charge for each additional character. If the sign is make of oak, add $20.00. No charge is added for pine. Black or white characters are included in the minimum charge; there is an additional $15 charge for gold-leaf lettering.arrow_forwardUse C++ Please do not copy and paste the same answer that is found on google. I have tried to get this to compile in visual studio and it always fails.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education