Temperature Converter
Beginner · Write the code · from Python Variables and Data Types: A Practical Introduction
From the lesson: Python Variables and Data Types: A Practical Introduction
Imagine you're shipping a package. You fill out a label that asks for the weight. You write "heavy" instead of a number. The shipping system crashes - it can't calculate a price from the word "heavy."
Read the lessonConvert a temperature from Fahrenheit to Celsius.
The formula is: **Celsius = (Fahrenheit - 32) * 5 / 9**
A variable fahrenheit is given with the value 98.6. Calculate the Celsius equivalent and print the result in this exact format:
98.6F = 37.0Cfahrenheit = 98.6
# Calculate celsius using the formula
# Print the result
More Variables and Data Types exercises
- Create Variables of Each TypeBeginner
- Predict the Output: Truthy or Falsy?Beginner
- Fix the Bug: String + Number CrashBeginner
- Swap Two VariablesBeginner
- Type Conversion ChainBeginner
All Python exercises · 50 practice problems · Python Fundamentals quiz