diff --git a/polynomial.py b/polynomial.py index e433c6869dbb08fd1e982e140743e019a1db26b3..6268848d8e8baf08a6e51d221ff69c390fa5ba33 100644 --- a/polynomial.py +++ b/polynomial.py @@ -17,8 +17,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)