Ask Question
19 November, 12:14

Trying to write a program in python that averages the value of 4 different test scores.

test1 = input ("Enter test score 1:")

test2 = input ("Enter test score 2:")

test3 = input ("Enter test score 3:")

test4 = input ("Enter test score 4:")

total = test1 + test2 + test3 + test4

average = total/4

print (average)

close = input ("Press any key to close")

For some reason line 5 isn't working. Maybe I need to make the different test variables an integer?

+1
Answers (1)
  1. 19 November, 13:50
    0
    Yes, you need to put int () around all the inputs, as it will automatically take the input values as strings and thus won't add them as numbers, but stick all the strings together
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Trying to write a program in python that averages the value of 4 different test scores. test1 = input ("Enter test score 1:") test2 = input ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers