理解数据类型与数学运算

f = float(input('请输入摄氏温度:'))

c =5/9*(f-32)

print('{:.2f}华氏温度转为摄氏温度为:{:.2f}'.format(f,c))

c = float(input('请输入华氏温度:'))

f = c*9/5+32

print('{:.2f}摄氏温度转为华氏温度:{:.2f}'.format(c,f))

posted @ 2018-04-23 16:52  金丽娜  阅读(106)  评论(0编辑  收藏  举报