168k views
20 votes
write a function called getscore that does not take any parameter inside the function it asks the user to input scores for 3 exams

1 Answer

9 votes

Answer:

Step-by-step explanation:

The following code is written in Python, like requested the getscore function asks the user for 3 score inputs and returns the final score.

def getscore():

exam1 = int(input("Enter Exam 1 score: "))

exam2 = int(input("Enter Exam 2 score: "))

exam3 = int(input("Enter Exam 3 score: "))

finalscore = (exam1 * 0.20) + (exam2 * 0.30) + (exam3 * 0.50)

return finalscore

User Eradman
by
7.8k points