写了一半,剩下的你自己发挥下吧
TepStr=input("请输入带有符号的温度值") ltepstr=TepStr.lower() if ltepstr.endswith('fa'): tep=(int(ltepstr[:-2])-32)/1.8 print("温度是{:.2f}{}".format(tep,"Ce"))