Ask 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 ("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?

+5
Answers (1)
  1. 2 November, 18:09
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers