Hi I'm very much a beginner with Python.
I want to write a function to convert celcius to fahrenheit like this
one:
def celciusToFahren heit(tc):
tf = (9/5)*tc+32
return tf
I want the answer correct to one decimal place, so
celciusToFahren heit(12) would return 53.6.
Of course the function above returns 53.600000000000 001.
How do I format it correctly?
I want to write a function to convert celcius to fahrenheit like this
one:
def celciusToFahren heit(tc):
tf = (9/5)*tc+32
return tf
I want the answer correct to one decimal place, so
celciusToFahren heit(12) would return 53.6.
Of course the function above returns 53.600000000000 001.
How do I format it correctly?
Comment