Question: Problem 2: Write a function with the following signature def matrixTranspose(L): Specification: L is a nested list representation of an mn matrix M. The function

Problem 2: Write a function with the following signature def matrixTranspose(L): Specification: L is a nested list representation of an mn matrix M. The function is required to return the nested list representation of the transpose of M, denoted MT, which is an nm matrix. For example, if M=[32104511] then MT=31052411. Therefore, if L=[[3,10,5],[2,4,11]] then the function should return the list [[3,2],[10,4],[5,11]]. Examples - matrixTranspose([[3, 10, 5], [2,4,11]]) should return [[3,2],[10,4],[5,11]] - matrixTranspose([[2], [5], [7]]) should return [[2,5,7]] - matrixTranspose([[2, 3], [5, 7], [7, 9], [9, 11]]) should return [[2,5,7,9],[3,7,9,11]] - matrixTranspose([[1, 1, 1, 1]]) should return [[1], [1], [1], [1]]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
