0 out of 68 challenges solved

Transpose a matrix

Question:
Write a function called transpose_matrix that takes a matrix represented as a list of lists and returns the transposed matrix. Use zip to transpose the matrix.

Example:
Input: [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
Output: [[1, 4, 7], [2, 5, 8], [3, 6, 9]]

def transpose_matrix(matrix):
    """
    Transposes a matrix represented as a list of lists.

    Args:
        matrix (list): The input matrix.

    Returns:
        list: The transposed matrix.
    """
    # TODO: Implement the transpose_matrix function
    pass