Answer the question
In order to leave comments, you need to log in
How to program a function in Python?
I don't understand what the problem is.
import math
a = 4.5
x = -1.9
print("y = f(x):\n\t| y = math.tan(a)+x, если x < 0\n\t| \
y = math.(2*a)**0.5-math.sin(x), если 0 < = x < =1\n\t| y = x**3-a**3, если x > 1")
if x < 0:
y = y = math.tan(a) + x
elif 0 <= x <= 1:
y = math.(2 * a) ** 0.5 - math.sin(x)
elif x > 1:
y = x ** 3 - a ** 3
pint(y)
Answer the question
In order to leave comments, you need to log in
Curators will be shocked by this xD
import math
a=4.5
x=-1.9
print("y = f(x):\n\t| y = math.tan(a)+x, если x < 0\n\t| \
y = math.(2*a)**0.5-math.sin(x), если 0 < = x < =1\n\t| y = x**3-a**3, если x > 1")
if x < 0:
y = math.tan(a)+x
print(y)
elif 0 <= x <= 1:
y = (2*a)**0.5-math.sin(x)
print(y)
elif x >1:
y = x**3-a**3
print(y)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question