← Back to challenges

Temperature Converter

PythonHardnumbersconditions

Instructions

Create a function that takes a list with temperature type, temperature, and a second temperature type. The temperature types can be Celsius, Fahrenheit, or Kelvin. Return the temperature type (in the list) converted into the second temperature type.

Examples

converter(["fahrenheit", 3] , "kelvin") ➞ 257.0

converter(["celsius", 10] , "fahrenheit") ➞ 50.0

converter(["celsius", 20] , "kelvin") ➞ 293.1

Notes

Round to one decimal place.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.