Answer:
def calc_average(s1, s2, s3, s4, s5):
return (s1 + s2 + s3 + s4 + s5) / 5
def determine_grade(s):
if 90 <= s <= 100:
return "A"
elif 80 <= s <= 89:
return "B"
elif 70 <= s <= 79:
return "C"
elif 60 <= s <= 69:
return "D"
else:
return "F"
scores = []
for i in range(5):
scores.append(int(input("Enter a test score: ")))
print(determine_grade(scores[i]))
print(str(calc_average(scores[0], scores[1], scores[2], scores[3], scores[4])))
Step-by-step explanation:
Create a function called calc_average that takes 4 test scores, calculates their average, and returns the average
Create a function called determine_grade that takes a test score, returns the grade depending on the grading scale
Create an empty lists that will hold the test scores
Create a for loop to get test scores from the user. After getting a score, call the determine_grade function to determine the grade of the score
When the loop is done, call the calc_average function to calculate the average of the given test scores