matrix dimensions python code example Example: size of matrix python >>> a=[[1,5,6,8],[1,2,5,9],[7,5,6,2]] >>> len(a) 3 >>> len(a[0]) 4