easy +5 pts

Fahrenheit to Celsius

Convert a temperature from Fahrenheit to Celsius in one simple function.

Write a function `fahrenheit_to_celsius(f)` that takes a temperature in degrees Fahrenheit (a number, possibly a float) and returns the equivalent temperature in degrees Celsius, rounded to two decimal places. The conversion formula is: Celsius = (Fahrenheit - 32) * 5/9. Round the result to two decimal places using the built-in `round()` function. Your function should handle both positive and negative temperatures, including integers and floats.

Constraints

- The input `f` will be any real number (int or float). - The output must be a float rounded to two decimal places.

Example

>>> fahrenheit_to_celsius(32)
0.0
>>> fahrenheit_to_celsius(212)
100.0
>>> fahrenheit_to_celsius(98.6)
37.0
5 points ~5 min

Recent Submissions

No submissions yet — hit Run Tests to try!

Hints

Use the formula (f - 32) * 5 / 9.
Wrap the result with round(..., 2).
Make sure to handle float inputs correctly.
Python 3
All tests passed!
Test Results
Press Ctrl+Enter or click Run Tests to execute your code.