Найдите 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)
Ответы
Ответ дал:
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)
Объяснение:
Выводилась в конце не верная преременная, ввод числа был строкой, суммировались не вводимые числа, а порядковые номера
Похожие вопросы
1 год назад
1 год назад
2 года назад
2 года назад
8 лет назад
8 лет назад
9 лет назад