def transpose(grid):
    """
    Switches rows and columns.
    
    >>> transpose([[1, 2, 3], [4, 5, 6]])
    [[1, 4], [2, 5], [3, 6]]
    """
    R = len(grid)
    C = len(grid[0])
    inverted = []
    for r in range(C):
        row = [c[r] for c in grid]
        inverted.append(row)
    return inverted