[Solved] python 2.7 function to convert temprature [closed]


Your function never actually makes the calculation. I think you’re looking for something like this:

def Cel2Fah(temp): 
    fah = temp * 9.0/5.0 + 32

    return fah

You can calculate 28C in Fahrenheit by calling the function like this:

Cel2Fah(28)

If you want to print 29C in Fahrenheit with 2 decimal places, here is ALL the code you need to run:

def Cel2Fah(temp): 
    fah = temp * 9.0/5.0 + 32

    return fah

print "{0:.2f}".format(Cel2Fah(29.0))

9

solved python 2.7 function to convert temprature [closed]