题目链接:https://python123.io/student/courses/5028/groups/64408/problems/programmings/6354#pagetop
解题代码:
TempStr = input()
if TempStr[-1] in ['F', 'f']:
C = (eval(TempStr[0:-1]) - 32) / 1.8
print("{:.2f}C".format(C))
elif TempStr[-1] in ['C', 'c']:
F = 1.8 * eval(TempStr[0:-1]) + 32
print("{:.2f}F".format(F))
else:
print("输入格式错误")