Traceback (most recent call last): ValueError: Invalid format specifier报错,求解答

#TempConvert.py

coding=gbk

Tempstr=input(‘请输入带有符号的温度值:’)
if Tempstr[-1] in [‘F’,‘f’]:
C=(eval(Tempstr[0:-1])-32)/1.8
print(“转换后的温度是{:,2f}C”.format©)
elif Tempstr[-1] in [‘C’,‘c’]:
F=1.8*eval(Tempstr[0:-1])+32
print(‘转换后的温度是{:,2f}’.format(F))
else:
print(‘生活好艰难’)

编译正常,运行后报错。比如输入45f

请输入带有符号的温度值:45f
Traceback (most recent call last):
File “1.py”, line 6, in
print(“转换后的温度是{:,2f}C”.format©)
ValueError: Invalid format specifier

累得很 2019/4/23 20:38:00
。。。。。。。谁能给解答下,问题出在哪里。。。

你可能感兴趣的:(Traceback (most recent call last): ValueError: Invalid format specifier报错,求解答)