Skip to content
Advertisement

Question regarding a matrix class function

First, here is my code:

JavaScript

When adding two (non-zero) matrices I can not make the result be printed nicely as my __str__ method would do, instead of having

JavaScript

I get the usual,

JavaScript

Does anyone have an idea on how to fix the issue?

Advertisement

Answer

The return type of add function is a list. It should be a matrix.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement