>>> is_square([]) True >>> is_square(matrix_1_to_4) True >>> is_square(matrix_5_to_9_high) False
(matrix: Matrix)
| 56 | |
| 57 | |
| 58 | def is_square(matrix: Matrix) -> bool: |
| 59 | """ |
| 60 | >>> is_square([]) |
| 61 | True |
| 62 | >>> is_square(matrix_1_to_4) |
| 63 | True |
| 64 | >>> is_square(matrix_5_to_9_high) |
| 65 | False |
| 66 | """ |
| 67 | len_matrix = len(matrix) |
| 68 | return all(len(row) == len_matrix for row in matrix) |
| 69 | |
| 70 | |
| 71 | def matrix_multiply(matrix_a: Matrix, matrix_b: Matrix) -> Matrix: |
no outgoing calls
no test coverage detected