We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Numpy
- Polynomials
- Discussions
Polynomials
Polynomials
Sort by
recency
|
245 Discussions
|
Please Login in order to post a comment
import numpy P=list(map(float,input().strip().split())) x=int(input())
print(numpy.polyval(P,x))
For Python3
code
import numpy print(numpy.polyval(list(map(float,input().split())),int(input())))
import numpy as np arr = np.array(list(map(float, input().split()))) x = int(input()) print(np.polyval(arr, x))
import numpy as np A = np.array(list(map(float,input().split()))) B=int(input()) print(np.polyval(A, B))