JustCaptain kod-buduschego
c70a58f596a8dfc2ab4b734e1775d88fdefe87b3
Перейти к файлу
Код
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