#134BeginnerVariables & Types· Numbers and Formatting
Temperature Converter
Input format
`value`: an int or float. `scale`: a string.
Output format
A string such as `"98.6 F"` or `"Unknown scale"`.
Examples
Input: value = 100, scale = "C"
Output: "212.0 F"
100 * 9 / 5 + 32 = 212.
Input: value = 0, scale = " f "
Output: "-17.8 C"
(0 - 32) * 5 / 9 = -17.77..., shown with one decimal place.
Constraints
- -500 <= value <= 5000
Study first
- #python
- #variables
- #floats
- #f-strings
