Найдите 3 ошибки и исправьте их print("This programm takes three numbers and returns...

0 голосов
74 просмотров

Найдите 3 ошибки и исправьте их print("This programm takes three numbers and returns the sum") total = 0 for i in range (3): x = input ("Enter a number:") total = total + i print("The total is:", x)


Информатика (14 баллов) | 74 просмотров
Дан 1 ответ
0 голосов

Ответ:

print("This programm takes three numbers and returns the sum")

total = 0

for i in range (3):

   x = int(input ("Enter a number:"))

   total = total + x

print("The total is:", total)

Объяснение:

Выводилась в конце не верная преременная, ввод числа был строкой, суммировались не вводимые числа, а порядковые номера

(4.0k баллов)