【发布时间】:2021-09-23 09:22:47
【问题描述】:
我想将我的摄氏温度转换为华氏温度,反之亦然。这是我给出的代码:
temperature=int(input('温度是多少?'))
type=input('是摄氏度还是华氏度:')
如果温度 == '摄氏度':
converted_temp = (temperature*9/5)+32
print("The converted temp in fahrenheitis: ",converted_temp)
elif 温度 == '华氏度':
converted_temp = (temperature-32)*5/9
print('The converted temperature in celsius is:',converted_temp)
其他:
print("SORRY! Enter either Celsius or Fahrenheit")
【问题讨论】:
-
请编辑问题以将其限制为具有足够详细信息的特定问题,以确定适当的答案。