Python 3.7.4: I'm wasting a second request for the same question because the person who answered the first one didn't pay attention to the question and won't respond to the comments.  I appreciate the help, I just ask that the question gets read in its entirety before you answer it.  Thank you for your help. ---------------------- The original assignment was to write a program that requests a year as input and states whether it is a leap year only using a while loop.  The new assignment is to take that same program and re-write it using functions.   --------------------------- Below is my original program. I need to change it so that it now has a main() function plus three more functions. It must be main() and nothing more advanced than that. The instructor said that it was a bad habit to include "break" in loops, so I was able to eliminate that.  ''' Determine if a given year is a leap year, running as many times as the user wants to check for leap years''' # instructionsprint('This program determines if a given year is a leap year.')year= input("Enter year or stop to exit: ") # processwhile year.upper() != "STOP": # provides a break to the loop    if int(year) % 400 == 0: # check if the year entered by user is a leap year or not        print(year,"is a leap year")    elif int(year) % 100 == 0:        print(year, "is not a leap year")    elif int(year)%4 == 0:        print(year,"is a leap year") # output    else:        print(year, "is not a leap year")    year= input("Enter year or stop to exit: ")print("Thank you.") --------------------------- I think that with the new program I need to use something like: def main():def isLeapYear():def close():def retry(): But I keep messing it up.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question

Python 3.7.4:

I'm wasting a second request for the same question because the person who answered the first one didn't pay attention to the question and won't respond to the comments.  I appreciate the help, I just ask that the question gets read in its entirety before you answer it.  Thank you for your help.

----------------------

The original assignment was to write a program that requests a year as input and states whether it is a leap year only using a while loop.  The new assignment is to take that same program and re-write it using functions.  

---------------------------

Below is my original program. I need to change it so that it now has a main() function plus three more functions. It must be main() and nothing more advanced than that. The instructor said that it was a bad habit to include "break" in loops, so I was able to eliminate that. 

''' Determine if a given year is a leap year, running as many times as the user wants to check for leap years'''

# instructions
print('This program determines if a given year is a leap year.')
year= input("Enter year or stop to exit: ")

# process
while year.upper() != "STOP": # provides a break to the loop
    if int(year) % 400 == 0: # check if the year entered by user is a leap year or not
        print(year,"is a leap year")
    elif int(year) % 100 == 0:
        print(year, "is not a leap year")
    elif int(year)%4 == 0:
        print(year,"is a leap year")

# output
    else:
        print(year, "is not a leap year")
    year= input("Enter year or stop to exit: ")
print("Thank you.")

---------------------------

I think that with the new program I need to use something like:

def main():
def isLeapYear():
def close():
def retry():

But I keep messing it up.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Operators
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education