A matrix is represented as a list of lists, where each inner list is one row of the matrix. All the rows of a matrix have the same length.
Write a function named dim_equal that accepts two matrices A and B as
arguments. It should return True if the dimensions of both matrices are the
same and False otherwise. Two matrices have the same dimensions when they have
the same number of rows and the same number of columns.
You may assume that both matrices have at least one row.
You do not have to accept input from the user or print anything to the console. You just have to write the function definition.
Example
dim_equal([[1, 2], [3, 4]], [[5, 6], [7, 8]]) -> True
dim_equal([[1, 2, 3]], [[1, 2]]) -> False
Implement this function:
def dim_equal(A, B):
Write the function only — the arguments are read for you and the return value is printed automatically.
Arguments arrive as one Python literal per line, in this order: A, B.
Input
[[1, 2], [3, 4]]
[[5, 6], [7, 8]]
Output
True