(self)
| 158 | |
| 159 | # Overwrite __str__ for print(); Shows A, B and A*B |
| 160 | def __str__(self): |
| 161 | a = "A = " + " + ".join( |
| 162 | f"{coef}*x^{i}" for i, coef in enumerate(self.polyA[: self.len_A]) |
| 163 | ) |
| 164 | b = "B = " + " + ".join( |
| 165 | f"{coef}*x^{i}" for i, coef in enumerate(self.polyB[: self.len_B]) |
| 166 | ) |
| 167 | c = "A*B = " + " + ".join( |
| 168 | f"{coef}*x^{i}" for i, coef in enumerate(self.product) |
| 169 | ) |
| 170 | |
| 171 | return f"{a}\n{b}\n{c}" |
| 172 | |
| 173 | |
| 174 | # Unit tests |
nothing calls this directly
no outgoing calls
no test coverage detected