Ad
  • Custom User Avatar

    But some of the tests are done with matrix = [[1,2,3], [4,5,6]] so we cannot suppose that our input is mandatorily a square matrix !
    Because if it was the case, then testing len(matrix) != len(matrix[0]) won't be necessary.

  • Custom User Avatar

    Hello,
    I think it doesn't work just testing the first element of the matrix. For example, your function will return something if your input is [[1,2,3], [4,5], [6, 7, 8]] whereas this is not a matrix.