Convert Temperature
Advanced
Convert Temperature Challenge
Welcome to the Temperature Converter!
In this challenge, your mission is to write a Python function that converts a temperature from Celsius to Fahrenheit. It's like having a little magical thermometer in your pocket, ready to change weather forecasts just for fun! 🌡️🎩
How does the conversion work?
The formula to convert from Celsius to Fahrenheit is:
( F = C \times \frac{9}{5} + 32 )
Where:
- C is the temperature in Celsius
- F is the temperature in Fahrenheit
Task
Write a function called convert_temperature that takes one argument:
celsius(a float) representing the temperature in Celsius.
The function should return the temperature in Fahrenheit as a float, rounded to one decimal place.
Example
Here's what your function should look like when it's executed:
convert_temperature(0) # Returns 32.0 convert_temperature(100) # Returns 212.0 convert_temperature(-40) # Returns -40.0 convert_temperature(37) # Returns 98.6
Isn't it fun to see how temperatures change through conversions? 🌍✨
Now, give it a try and show your coding magic! 🎉
Inputs
Arg 1:
0Expected Output
32.0Actual Output