136k views
7 votes
Write a program that will take the three test grades as input and tell what her average test grade is?

User Huzle
by
5.4k points

1 Answer

8 votes

Answer:

Step-by-step explanation:

The following code is written in Python programming language and as requested takes three int/float variables. Then it sums up the three grades and places the result into a variable called sum. Then it creates a variable called average and divides the sum by three to get the actual average. Finally, it prints the value of the average variable to the user.

def average(gradeOne, gradeTwo, gradeThree):

sum = gradeOne + gradeTwo + gradeThree

average = sum / 3

print(average)

User Yam Mesicka
by
5.9k points