I want to make two polynomials and then add them. We have two lists, [1,2,0,3] and [2,3,0,0,1].
The polynomials are as followed: 3x^3+2x+1 and x^4+3x+2.
I have the following code, but I'm getting stuck. Any advice? I'm new to python.
def polyAdd(poly1,poly2):
for i in range(len(poly1)):
z = poly1[i]
return z
for j in range(len(poly2)):
y = poly2[j]
return y
if i == j:
coef = y + z
print(coef)