Write a function called celsiusToFaherenheit which takes 1 input: degrees in Celsius, and returns one output: degrees in Fahrenheit. The formula to convert Celsius to Fahrenheit is (°C × 9/5) + 32 = °F.
Write a function called printCelsiusToFaherenheit which takes no inputs and returns no outputs. This function should use celsiusToFaherenheit from part 3 as a helper function. This function should print the value of 17 degrees Celsius converted to Fahrenheit.
#takes celsius and converts to Faherenheit
def celsiusToFaherenheit(c):
return (c * 9.0/5.0) + 32
def printCelsiusToFaherenheit():
#converting into Faherenehit
#printing the result
f = (17 * 9.0/5.0) + 32;
print("17 degrees Celsius converted to Fahrenheit : ",f)
print("37 degrees Celsius converted to Fahrenheit : ",celsiusToFaherenheit(37))
printCelsiusToFaherenheit()
Get Answers For Free
Most questions answered within 1 hours.