import numpy as np
print("Polynomial value when x = 2:")
print(np.polyval([1, -2, 1], 2))
print("Polynomial value when x = 3:")
print(np.polyval([1, -12, 10, 7, -10], 3))
Sample Output:
Polynomial value when x = 2:
1
Polynomial value when x = 3:
-142
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer