Question: Write a PYTHON program that asks the user to enter five test scores. The program will display the average of the test scores and the
Write a PYTHON program that asks the user to enter five test scores. The program will display the average of the test scores and the letter grade for the average. You will have function calculate_average that accepts five test scores as arguments and returns the average of the scores. You will have function determine_grade that accepts the average and returns the letter grade that represents that average. Enter score 1: 90 Enter score 2: 80 Enter score 3: 70 Enter score 4: 60 Enter score 5: 100 The average is 80.0 The grade is B
.
this is what i have so far
def main(): grade1 = int(input("Enter score 1:")) grade2 = int(input("Enter score 2:")) grade3 = int(input("Enter score 3:")) grade4 = int(input("Enter score 4:")) grade5 = int(input("Enter score 5:")) print("The average is", format(average, '.1f')) def calculate_average(grade1,grade2,grade3,grade4,grade5): total = grade1 + grade2 + grade3 + grade4 + grade5 average = total / 5 return average
How do get the value i got from def calculate_average return to main() so it can print?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
