def equation(x):
if 1 < x <= 20:
y = (5.34+x**2)/(1+x)
elif x <= 1:
y = 7.5 * x**2 - 1.7 * x**2
elif x > 20:
q = 4.2
y = 1 + x**3 + q
return y
print(equation(float(input())))
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
def equation(x):
if 1 < x <= 20:
y = (5.34+x**2)/(1+x)
elif x <= 1:
y = 7.5 * x**2 - 1.7 * x**2
elif x > 20:
q = 4.2
y = 1 + x**3 + q
return y
print(equation(float(input())))