HackerRank Python - Polynomials


The poly tool returns the coefficients of a polynomial with the given sequence of roots.


The roots tool returns the roots of a polynomial with the given coefficients.


The polyint tool returns an antiderivative (indefinite integral) of a polynomial.


The polyder tool returns the derivative of the specified order of a polynomial.


The polyval tool evaluates the polynomial at specific value.


The polyfit tool fits a polynomial of a specified order to a set of data using a least-squares approach.

  1. import numpy as np
  2. poly = [float(x) for x in input().split()]
  3. x = float(input())
  4. print(np.polyval(poly, x))
Please click on the like button if it worked

Solution not working or have any suggestions? Please send an email to [email protected]

donate a cup of tea :)

Join Our Facebook Group

Share this solution


Codesadda.com is your home of programming solutions, tutorials, video tutorials and much more. Sign Up for our weekly newsletter to get update about new content.

Like us on Facebook | Connect with us on LinkedIn | Subscribe our Channel on Youtube