Temperature

In this post we are going to create a programm that convert Farenheit degrees to Celsius.

Here is the code:

captura-de-pantalla-2017-02-08-a-las-18-10-58

But let’s explain: First we define our function and indicate what we want it give us.  If you have doubts with the formula, I recomend you to check this link: http://www.pythonforbeginners.com/code-snippets-source-code/python-code-celsius-and-fahrenheit-converter

Then, we declate f that will be the way we call Farenheit. It is an int, and also and input, because we ask the user for the value of farenheit he want. With that, we continue declarating c, the way we are calling Celsius degrees. For this, we call our function that has the same name.

In this moment,  we already have the results and we only need to print them out.

Water boils at 100 ºC, right? so, now that we have or information in degrees we could tell this information to the user to. We use a conditional to indicate and after that, we just print the statement.

Finally, in this youtube video is the process I had explain in this blog: Fahrenheit to Celsius Program in Python

And this is how the code runs:

captura-de-pantalla-2017-02-08-a-las-18-11-41

🙂

Mastery topics: Calling functions/Creating functions

Leave a comment