Temperature Machine 🌡️
Some countries measure heat in Celsius, others in Fahrenheit. The conversion is:
multiply by 9, divide by 5, then add 32
So 100°C (boiling water) becomes 100 × 9 ÷ 5 + 32 = 212°F. 🔥
In Python that's:
f = c * 9 / 5 + 32
Python does * and / before +, same as in maths class, so you
don't even need brackets.
Your mission
Write a function called c_to_f that takes a temperature in
Celsius and returns it in Fahrenheit.
def c_to_f(c):
return ...
I'll test it with freezing (0), boiling (100), body temperature (37) and
one very cold surprise. return the number — don't print it! 🎯
Your code
Press ▶ Run to see what your code does!