# C = ( F - 32 ) / 1.8
# F = C * 1.8 + 32
def tempConvert():
t = input("请输入数值:")
C = ["c","C"]
F = ["F","f"]
if t[0] in C:
temp = (float(t[1:])*1.8) +32
temp = "{:.2f}".format(temp)
temp = "F" + str(temp)
print("结果:",temp)
elif t[0] in F:
temp =(float(t[1:])-32)/1.8
temp = "{:.2f}".format(temp)
temp = "C" + str(temp)
print("结果:",temp)
else:
print("输入格式错误")
return False
return temp
tempConvert()