Temperature Converter

Published by lllll in

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.

Watch a quick demo on how Edabit works.