A matrix is represented as a list of lists, where each inner list is one row of the matrix. All the rows have the same length. Zero-based indexing is used throughout, so the first row is at index 0.
Write a function named get_row that accepts a matrix named mat and a
non-negative integer named row as arguments. It should return the row that is
at index row in the matrix mat, as a list.
You may assume that row is a valid row index for mat.
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
get_row([[1, 2, 3], [4, 5, 6]], 1) -> [4, 5, 6]
Implement this function:
def get_row(mat, row):
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: mat, row.
Input
[[1, 2, 3], [4, 5, 6]]
0
Output
[1, 2, 3]