In this post I’m going to show a program that will convert a given temperature from Fahreinheit to Celsius, and then state whether or not the water would boil at this temperature.
To do this I decided to use a function. Even though it is not that necessary to do it like this, I thought it was a good way to start practicing using functions.
Defining a function in python looks like this:
You can read more about that from the page I got it from: http://hcc-cs.weebly.com/functions.html
So, to solve this problem I defined the function like this:
def Celsius(x):
return 5*(x-32)/9
And this is how my whole problem ended up looking:
Which runs like this:
One thought on “Temperature!”