#WSQ02 – Temperature

Here are the instructions:

Write a program that will prompt the user for a temperature in Fahrenheit and then convert it to Celsius. You may recall that the formula is C = 5 ∗ (F − 32)/9. Modify the program to state whether or not water would boil at the temperature given.

  1. We know that the water boils at 100°C.
  2. We write the input function asking for the temperature Fahrenheit without forgetting to convert the string into an integer in order to do mathematical operations with it!
  3. Then easy, just need to convert Fahrenheit into Celsius using the formula given C = 5 ∗ (F − 32)/9. Once again, we need to convert the string of text Celsius into an integer.
  4. Here is the novelty: the conditional execution. I found the table summarising the comparison operations on https://docs.python.org/2/library/stdtypes.html
  5. We know that water boils only if the temperature of the water is greater or equal than 100; otherwise the water does not boil
  6. I used this tutorial to see how to write the if/else statement properly https://www.tutorialspoint.com/python/python_if_else.htm

Leave a comment