Я несколько раз пытался переписать свой код, но в строке 16 постоянно получаю сообщение об ошибке. Вот мой код:
choice = input("fc; cf; fk;?")
if (choice == 'fc'):
def fc():
fahrenheit = int(input("enter temp: "))
celsius = (fahrenheit - 32) / 1.8
print(celsius)
fc()
elif (choice == 'cf'):
def cf():
celsius = int(input("enter temp: "))
fahrenheit = (celsius * 1.8) + 32
print(fahrenheit)
cf()
elif (choice == 'fk'):
def fk():
fahrenheit = int(input("enter temp: "))
kelvin = 5/9(fahrenheit - 32) + 273
print(kelvin)
fk()
Подробнее здесь: https://stackoverflow.com/questions/411 ... t-callable
Мобильная версия