The third derivative of the polynomial function $P(x) = 3x^3 + 2x - 7$ is $18$, so why does the following evaluate as False
?
In [x]: Polynomial((-7, 2, 0, 3)).deriv(3) == 18
Out[x]: False
The Polynomial
deriv
method returns a Polynomial
object (in this case with a single term, the coefficient of $x^0$, equal to 18
. This object is not equal to the integer object with value 18
.