Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need to be able to have three inputs for years. Then I need it to come out with and average. # Error found in

I need to be able to have three inputs for years. Then I need it to come out with and average.

# Error found in this function:

#

def getGrade():

grade = input("Enter your test score: ")

return grade

# Error found in this function:

#

def all_As(test1, test2, test3):

if 89 < test1 and 89 < test2 and 89 < test3:

print("Wow! ", end="")

print("You scored all As on your exams!")

print("Nice job!")

# Error found in this function:

#

def calc_average(test1, test2, test3):

return ((test1 + test2 + test3) // 3)

# Error found in this function:

#

def letter_grade(grade):

if grade >= 90:

print("You earned an A")

if grade >= 80:

print("You earned an B")

if grade >= 70:

print("You earned an C")

if grade >= 60:

print("You earned an D")

if grade < 60:

print("You earned an F")

# THERE ARE NO ERRORS IN THE MAIN

#-----main-----

print("Enter 3 test scores:")

first_test = getGrade()

second_test = getGrade()

third_test = getGrade()

print()

all_As(first_test,second_test,third_test)

average = calc_average(first_test, second_test, third_test)

print("Your test average is",average)

letter_grade(average)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions

Question

1. What are the major sources of stress in your life?

Answered: 1 week ago