Linda M.

asked • 12/05/20

PYTHON QUESTION

Write a python program using a function to prompt the user for a score between 1 and 100. If the score is out of range, print an error message and exit. If the score is between 0 and 100, print a grade using the table below. Create a function called gradecalculation that takes a score as its parameter and returns a grade as a string.


Score Grade
>= 90 A
>= 80 B
>= 70 C
>= 60 D
< 60 F


Patrick B.

source code uploaded to RESOURCES section
Report

12/05/20

1 Expert Answer

By:

Patrick B. answered • 12/05/20

Tutor
4.7 (31)

Math and computer tutor/teacher

Hoan T.

If you are making sure that the grade is within range of 0-100, might as well make sure the input is not malformed (chars, etc) using try except.
Report

12/07/20

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.