def f(x): return x**2 if (x >= -2.4 and x <= 5.7) else 4
# Тест
import numpy
Ox=numpy.arange(8)
Oy=[f(x) for x in Ox]
import matplotlib.pyplot as plt
plt.plot(Ox, Oy, color='g')
plt.show()
def f(x): return x**2 if (x >= -2.4 and x <= 5.7) else 4
# Тест
import numpy
Ox=numpy.arange(8)
Oy=[f(x) for x in Ox]
import matplotlib.pyplot as plt
plt.plot(Ox, Oy, color='g')
plt.show()