Reputation: 1063
I create a 2D List with n cols and m rows:
2DList = [[0 for x in range(cols)] for y in range(rows)]
How can I get the number of cols and rows with the simple method?
Upvotes: 4
Views: 8537
Reputation: 1875
No.of rows = len(matrix)
No.of cols = len(matrix[0])
, if all the rows are of same size
Upvotes: 9