Question 1
The string temp is a number followed by a letter for the unit: C for degrees Celsius or K for kelvin, like "10C" or "290K". Write a function classify_temperature(temp) that changes kelvin to degrees Celsius by subtracting 273.15, and returns "Cold" if the temperature in Celsius is below 15, "Moderate" if it is from 15 to 30 (both included), and "Hot" if it is above 30.
NOTE: This is a function type question, you don't have to take input or print the output, just have to complete the required function definition.
Example
classify_temperature("10C") -> 'Cold'
classify_temperature("290K") -> 'Moderate'
Your task
Implement this function:
def classify_temperature(temp: str) -> str:
Write the function only — the arguments are read for you and the return value is printed automatically.
Arguments arrive as one Python literal per line, in this order: temp.
Example
Input
"10C"
Output
'Cold'