Im возникли проблемы с моим кодом, и это говоритTypeError: неподдерживаемый тип операнда (ов) для +: «INT» и «ул» ошибка
TypeError: unsupported operand type(s) for +: 'int' and 'str'
и я не знаю, почему. область моего кода, которая вызывает это, показана ниже, вся помощь будет оценена: D! * Отредактируйте ошибку, похоже, происходит из-за параметров ввода, если это помогает в любом случае.
Score1 = str(input("what did the first person get in their test the first time?"))
Score2 = str(input("what did the first person get in their test the second time?"))
Score3 = str(input("what did the first person get in their test the third time?"))
Score4 = str(input("what did the second person get in their test the first time?"))
Score5 = str(input("what did the second person get in their test the second time?"))
Score6 = str(input("what did the second person get in their test the third time?"))
Score7 = str(input("what did the third person get in their test the first time?"))
Score8 = str(input("what did the third person get in their test the second time?"))
Score9 = str(input("what did the third person get in their test the third time?"))
P1S = [Score1, Score2, Score3]
P2S = [Score4, Score5, Score6]
P3S = [Score7, Score8, Score9]
print ("here are the scores of",Name1,",well done") # defines scores
print(P1S)
print ("here is the average score of",Name1,",Well Done") # makes average of scores
print(sum(P1S)/float(len(P1S)))
print ("here are the scores of",Name2,",well done") # defines scores
print(P2S)
print ("here is the average score of",Name2,",Well Done") # makes average of scores
print(sum(P2S)/float(len(P2S)))
print ("here are the scores of",Name3,",well done") # defines scores
print(P3S)
print ("here is the average score of",Name3,",Well Done") # makes average of scores
print(sum(P3S)/float(len(P3S)))
Я думаю, что вам нужно вывести входы 'Score' для int, они первоначально интерпретируются как строки – EdChum
Можете ли вы объяснить, что вы хотите сделать? Кроме того, вы могли бы уменьшить свой код, чтобы он был минимальным, чтобы показать eror? –
Я хочу, чтобы я мог использовать свои входы в качестве чисел для работы в сумму –