Skip to content
Snippets Groups Projects
Commit 8043d7b2 authored by quentin.fasler's avatar quentin.fasler
Browse files

add pass_x_throughout

parent 6d3b69a3
No related branches found
No related tags found
No related merge requests found
......@@ -16,8 +16,12 @@ class Polynomial:
self.value = value
def pass_x_throughout(self, x):
pass
a = list(self.value)
sum = (a[len(a)-1]*x)+a[len(a)-2]
for i in reversed(range(len(a)-2)):
sum = sum*x+a[i]
return sum
def __add__(self, other):
a = list(self.value)
b = list(other.value)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment