Fahrenheit to Celsius Converter

Fahrenheit-CelsiusDegree Fahrenheit (°F) and Degree Celsius (°C) are the main two units to measure temperature.

The Fahrenheit scale is used mainly in the USA whereas other countries tend to use the Celsius scale.

It is possible to convert a temperature from Celsius degrees to Fahrenheit and vice-versa using the following conversion formulas:

Your Challenge

Write a Python script to:

  • Ask the end-user whether they want to convert from Fahrenheit to Celsius or from Celsius to Fahrenheit,
  • Ask the user to enter a temperature in the correct unit,
  • Apply the conversion formula and display the temperature in the new unit.

Challenge #2

On the temperature scale, the 0°C (=32°F is called Freezing Point which is when water starts freezing and becomes ice. At 100°C (=212°F) water starts to boil. This is called Boiling Point.

Adapt your script to write a message to the end user as follows:

  • You are above boiling point for all temperatures above 100°C
  • You have reached boiling point if the temperature is exactly 100°C
  • You are between freezing point and boiling point for all temperatures between 0°C and 100°C
  • You have reached freezing point if the temperature is exactly 0°C
  • You are below freezing point for all temperatures below 0°C
Share Button
Tagged with: