'''
Задание 2.2.

Составьте программу, вычисляющую функцию y(x), заданную следующим правилом:
'''


def y(x: int) -> int:
    if 0 <= x and x < 15:
        return 2 * x * x * x

    if 15 <= x and x < 30:
        return 2 * x * x

    if 30 <= x and x < 45:
        return 2 * x

    if 45 <= x and x < 60:
        return 1

    if x < 0 or x >= 60:
        return x * x * x

x = input('x: ')
x = int(x)
x = y(x)

print(x)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: