标签:highlight 输入 bsp inf print inpu 转换 分享 bre
while True:
a = input(‘摄氏转华氏按1 华氏转摄氏按2‘)
if a == ‘1‘:
#输入
c = input(‘请输入摄氏温度:‘)
#计算
f = float(c)*9/5+32
#输出
print(‘{}摄氏度转华氏度为{}‘ .format(c,f))
elif a==2:
#输入
f = float(input(‘请输入华氏温度:‘))
#计算
c = 5/9*(f-32)
#输出
print(‘{}华氏度转摄氏度为{}‘ .format(c,f))
else:
break

标签:highlight 输入 bsp inf print inpu 转换 分享 bre
原文地址:https://www.cnblogs.com/kidmarshall/p/8947177.html