Skip to content

Instantly share code, notes, and snippets.

@Svastikkka
Last active August 25, 2020 09:18
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Svastikkka/71a7f037084608d626f5d806c1e64976 to your computer and use it in GitHub Desktop.
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))
@Svastikkka
Copy link
Author

Horner rule

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment