def wd():
w=input('请输入一个摄氏温度或者一个华氏温度,如,34c/C or 34f/F:')
if w[-1] in ['c','C']:
w=float(w[:-1])
hs=1.8*w+32
print('华氏温度:{:.2f}F'.format(hs))
elif w[-1] in ['f',' F']:
w=float(w[:-1])
ss=(w-32)/1.8
print ('摄氏温度:{:.2f}C'.format(ss))
wd()
05-11 11:09