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.
classify_temperature("10C") -> 'Cold'
classify_temperature("290K") -> 'Moderate'
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.
Input
"10C"
Output
'Cold'
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: ```python 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' ``` Write a function `is_case_insensitive_strict_prefix(a, b)` that returns `True` if one of the two non-empty strings is the beginning of the other one and they are not the same, without regard to upper or lower case. Otherwise it returns `False`. 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 ``` is_case_insensitive_strict_prefix("app", "apple") -> True is_case_insensitive_strict_prefix("App", "APPLE") -> True ``` ## Your task Implement this function: ```python def is_case_insensitive_strict_prefix(a: str, b: str) -> bool: ``` 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: `a`, `b`. ## Example **Input** ``` "app" "apple" ``` **Output** ``` True ``` Write a function describe_number that takes an integer as input and returns: ``` "Fizz" if the number is divisible by 3. "Buzz" if divisible by 5. "FizzBuzz" if divisible by both 3 and 5. "Normal" if it is divisible by neither. ``` 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 ``` describe_number(9) -> "Fizz" describe_number(10) -> "Buzz" describe_number(15) -> "FizzBuzz" describe_number(7) -> "Normal" ``` ## Your task Implement this function: ```python def describe_number(num: int) -> 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: `num`. ## Example **Input** ``` 9 ``` **Output** ``` 'Fizz' ```