Question: A Python program that checks if the input value is a leap year and is a century year (ending in 00) how can I Define

  1. A Python program that checks if the input value is a leap year and is a century year (ending in 00) how can I Define a function  called leap_check that takes a parameter called input_year and returns an int value
  2. 1 if its input_year ends in 00 and is a leap year
  3. 0 if input_year is not a leap year
  4. -1 if input_year is a leap year but does not end in 00
  5. Define a function called main
  6. Ask the user for a year to be input
  7. Validate that the input value is a positive 4-digit number
  8. If it is a 4 digit number
  9. call the leap_check function and pass in the input value
  10. Display with a descriptive sentence as one of the following based on the return value
  11. (Hint: you will need an if statement to determine which line gets displayed)
  12. is a leap year and a century year 
  13.  
  14. is a leap year but not a century-year
  15.  
  16. is not a leap year
  17. if its not a 4 digit year
  18. Display a message "Invalid input"
  19. Your program should terminate after displaying the message if it reaches this branch
  20.  
  21. Don't forget to call main() as the last line of your script.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

def leapcheckinputyear Check if its a leap year if inputyear 4 0 and inputye... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!