Converts Celsius degrees to Fahrenheit

Create a function that converts Celsius degrees to Fahrenheit. The formula to convert Celsius to Fahrenheit is F = C × 9/5 + 32.

  

def cel_to_fahr(celsius): 
    fahrenheit = celsius * 9/5 + 32 
    return fahrenheit

 

And here is an example of calling the function:

print(cel_to_fahr(10))

That would return 50.0 which means 10 degree Celsius is equal to 50 degree Fahrenheit.

 

No comments

Powered by Blogger.