diff --git a/matrix_transpose.py b/matrix_transpose.py index 093655d..bb1fda3 100644 --- a/matrix_transpose.py +++ b/matrix_transpose.py @@ -13,9 +13,12 @@ Example: ... ] >>> matrix_transpose(matrix) [[1, 4], [2, 5], [3, 6]] + +NOTE: If you import the matrix_transpose module into your project, call it with matrix_transpose.transpose(M). + """ -def matrix_transpose(M) -> List[List]: +def transpose(M) -> List[List]: row = [] T = [] mcols = len(M[0]) @@ -27,15 +30,3 @@ def matrix_transpose(M) -> List[List]: row = [] return T -matrix = [ - [1,2,3,0], - [4,5,6,1], - [7,8,9,2], - [1,2,3,4], - [4,5,6,7] -] - -print(matrix_transpose(matrix)) - -# Output -# [[1, 4, 7, 1, 4], [2, 5, 8, 2, 5], [3, 6, 9, 3, 6], [0, 1, 2, 4, 7]] \ No newline at end of file