Python:Traceback
Проблема:выдает Traceback (most recent call last):
File "C:\Users\Eagle2002\Desktop\python\fourth.py", line 5, in
opt = h - w
TypeError: unsupported operand type(s) for -: 'str' and 'str'
Программа ниже:

print('Контроль веса')
print('Введите ваш рост и вес')
h = input('Рост(см)->')
w = input('Вес(кг)->')
opt = h - w
if w == opt:
print('Ваш вес оптимален!')
elif w < opt:
rly = opt - w
print('Вам надо поправиться на', rly, 'кг.')
elif w > opt:
rly = w - opt
print('Вам надо похудеть на', rly, 'кг.')
Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Copyright © 2024 SCHOLAR.TIPS - All rights reserved.