JustCaptain kod-buduschego
llm/change-23ccdc
Перейти к файлу
Код
task_4.py
def temp_converter(value: float, from_scale: str, to_scale: str) -> float:
    result: float = 0.0
    if from_scale == "C" and to_scale == "F":
        result = value * 9 / 5 + 32
    elif from_scale == "F" and to_scale == "C":
        result = (value - 32) * 5 / 9
    else:
        result = value
    return result