Код: Выделить всё
total=0
while True:
number= int(input('enter nam: \n'))
if number=='done':
break
total=number+total
print(total)
Код: Выделить всё
File "d:\python\lo.py", line 4, in
number= int(input('enter nam: \n'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: 'done'
PS D:\python>
Моя проблема в том, что я получаю две ошибки каждый раз, когда ввожу только ввод, а когда ввожу int(ввод), они вообще не складываются
Подробнее здесь: https://stackoverflow.com/questions/790 ... -it-to-int
Мобильная версия