最后输出的只有一个值,到底是怎么转换的?
凑字数:只要心中有坚定的信念,目光所及之处,便是一往无前。
def convert(f = None, c = None):
if f:
return "{}F<--->{}C".format(round(float(f), 2), round((f - 32) * 5 / 9, 2))
else:
return "{}C<--->{}F".format(round(float(c), 2), round(9 * c / 5 + 32, 2))
res = convert(f = -45)
print(res)