Last active
August 25, 2020 09:18
-
-
Save Svastikkka/71a7f037084608d626f5d806c1e64976 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def hornerRule(poly,n,x): | |
result=poly[0] | |
for i in range(1,n): | |
result=result*x+poly[i] | |
return result | |
arr=list(map(int,input().split)) | |
x=int(input()) | |
len=len(arr) | |
print(hornerRule(arr,len,x)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Horner rule