Ask Question
12 February, 12:38

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?

+2
Answers (1)
  1. 12 February, 15:26
    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?
Get 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 & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers