The problem is with this line:
return (z[0])*x**6 (z[1])*x**5 + (z[2])*x**4 + (z[3])*x**3 + (z[4])*x**2 + (z[6])*x + z[7]
You forgot a +
between (z[0])*x**6
and (z[1])*x**5
.
Here is the fixed version:
return (z[0])*x**6 + (z[1])*x**5 + (z[2])*x**4 + (z[3])*x**3 + (z[4])*x**2 + (z[6])*x + z[7]
Without the +
, you try to call (z[0])*x**6
, which is an integer, by placing (z[1])
directly after it.