Python Variables
💡
Exercise 7

Temperature 10 XP Easy

Ctrl+Enter Run Ctrl+S Save

Now let's use arithmetic operators to do math with variables!

Python supports these operators:

  • `+` Addition
  • `-` Subtraction
  • `*` Multiplication
  • `/` Division
  • `**` Exponent (power)
  • `%` Modulo (remainder)

The formula to convert Fahrenheit to Celsius is:

celsius = (fahrenheit - 32) / 1.8
📋 Instructions
Create a variable `fahrenheit` and set it to `98.6`. Then convert it to Celsius using the formula: ```python celsius = (fahrenheit - 32) / 1.8 ``` Print the result: ``` 37.0 ```
Formula: fahrenheit = celsius * 9/5 + 32. Store the result in a variable and print it with an f-string: print(f'{celsius}°C = {fahrenheit}°F').
⚠️ Try solving it yourself first — you'll learn more!
celsius = (fahrenheit - 32) / 1.8
🧪 Test Cases
Input
Run your code
Expected
37.0
Expected program output
main.py
Hi! I'm Rex 👋
Output
Ready. Press ▶ Run or Ctrl+Enter.