find the size of a matrix in python code example
Example 1: size of matrix python
>>> a=[[1,5,6,8],[1,2,5,9],[7,5,6,2]]
>>> len(a)
3
>>> len(a[0])
4
Example 2: length of a matrix in python
matrix = [[1, 2]]
rows = len(matrix) # Height.
columns = len(matrix[0]) # Width.
print(rows)
print(columns)