diff --git a/polynomial.py b/polynomial.py index ef82cc09dbbebd55a06d6d882045050f75f1f8d4..e385491f7175df0afdc9dfe946ede2a701aaeb29 100644 --- a/polynomial.py +++ b/polynomial.py @@ -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)