温度转换

'''
    str=input()
if str[-1] in ['c', 'C']:
    F = eval(str[0:-1]) * 1.8 + 32
    print("{:.2f}.F".format(F))
if str[-1] in ['c', 'C']
    str[]
'''
tem=input()
if tem[-1] in ['c','C'] :
    F = eval(tem[0:-1]) * 1.8 + 32
    print("{:.2f}F".format(F))
elif tem[-1] in ['F','f'] :
    C = (eval(tem[0:-1]) - 32)/1.8
    print("{:.2f}C".format(C))
else :
    print("输入格式错误")

你可能感兴趣的:(python)