Я продолжаю получать эту ошибку: < /p>
"TypeError: can only concatenate str (not "int") to str"
-----------------------------------------------------------------------------------
< /code>
Введите описание изображения здесь < /p>
import math
temp_input = input(
'Insert the temperature you would like to convert(100F , 35C for example):')
unit = temp_input[-1].lower()
number = temp_input[:-1]
F_temp = ((( 9 *(number)) + 160) // 5)
C_temp = (((5 * (number)) - 160) // 9)
if temp_input[-1:] == 'f':
print(C_temp)
elif temp_input[-1:] == 'c':
print(F_temp)
else:
print('try to add C / F , after the numbers !')
Подробнее здесь: https://stackoverflow.com/questions/795 ... to-celsius
Я пытаюсь сделать калькулятор от Фаренгейта в Цельсия ⇐ Python
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Python: создайте функцию для преобразования из Фаренгейта в Цельсия [закрыто]
Anonymous » » в форуме Python - 0 Ответы
- 3 Просмотры
-
Последнее сообщение Anonymous
-