当我在http://www.pyschools.com/quiz/view_question/s2-q1中执行此代码时。它给出了两个答案的错误......请帮助问题是:
Write a function to convert temperature from Celsius to Fahrenheit scale.
oC to oF Conversion: Multipy by 9, then divide by 5, then add 32.
Examples
>>> Cel2Fah(28.0)
'82.40'
>>> Cel2Fah(0.00)
'32.00'
我的答案
# Note: Return a string of 2 decimal places.
def Cel2Fah(temp):
x = 9.00
y = 5.00
z = 32.00
a = temp * x
a = a / y
a = a + z
return(a)