while True: a = input('1:摄氏度转华氏度\n2:华氏度转摄氏度\n3:退出\n') if a =='1': celsius=float(input('输入摄氏度:')) fahrenheit=(celsius*9/5)+32 print('{:.2f}摄氏度转化为华氏度{:.2f}'.format(celsius,fahrenheit)) elif a =='2': fahrenheit=float(input('请输入华氏度:')) celsius=9/5*(f-32) print('{:.2f}华氏度转为摄氏度:{:.2f}'.format(fahrehheit,celsius)) else: break:
作业4
猜你喜欢
转载自www.cnblogs.com/zhuwenhao/p/8920199.html
今日推荐
周排行