Input Format
The first line contains the space separated value of the coefficients in .
The second line contains the value of .
Output Format
Print the desired value.

hackerrank polynomials problem solution in python

Problem solution in python 2 programming language.

import numpy
P  = map(float, raw_input().split())
x = float(raw_input())
print numpy.polyval(P, x)

Problem solution in python 3 programming language

import numpy
P  = map(float, input().split())
x = float(raw_input())
print(numpy.polyval(P, x))