This is very easy. have a look at the following code -
>>> def f(y):
return str(y**2) + 'x'
And if you have the value of constant then
Suppose you have a polynomial equation such as
p(x)=x4−4⋅x2+3⋅xp(x)=x4−4⋅x2+3⋅x then in this case :
>>> def p(x):
return x**4 - 4*x**2 + 3*x