returns a string representation of this matrix.
(self)
| 280 | self.__height = h |
| 281 | |
| 282 | def __str__(self): |
| 283 | """ |
| 284 | returns a string representation of this |
| 285 | matrix. |
| 286 | """ |
| 287 | ans = "" |
| 288 | for i in range(self.__height): |
| 289 | ans += "|" |
| 290 | for j in range(self.__width): |
| 291 | if j < self.__width - 1: |
| 292 | ans += str(self.__matrix[i][j]) + "," |
| 293 | else: |
| 294 | ans += str(self.__matrix[i][j]) + "|\n" |
| 295 | return ans |
| 296 | |
| 297 | def changeComponent(self, x, y, value): |
| 298 | """ |
no outgoing calls