(self, other: Matrix)
| 306 | ) |
| 307 | |
| 308 | def __sub__(self, other: Matrix) -> Matrix: |
| 309 | if self.order != other.order: |
| 310 | raise ValueError("Subtraction requires matrices of the same order") |
| 311 | return Matrix( |
| 312 | [ |
| 313 | [self.rows[i][j] - other.rows[i][j] for j in range(self.num_columns)] |
| 314 | for i in range(self.num_rows) |
| 315 | ] |
| 316 | ) |
| 317 | |
| 318 | def __mul__(self, other: Matrix | float) -> Matrix: |
| 319 | if isinstance(other, (int, float)): |