import numpy as np
print("Roots of the first polynomial:")
print(np.roots([1, -2, 1]))
print("Roots of the second polynomial:")
print(np.roots([1, -12, 10, 7, -10]))
Sample Output:
Roots of the first polynomial:
[ 1. 1.]
Roots of the second polynomial:
[ 11.04461946+0.j -0.87114210+0.j 0.91326132+0.4531004
j
0.91326132-0.4531004j]
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer