import copy


def sub_mat(in_mat, my_row, my_col):
    """
    This function returns a sub-matrix of 'my_mat', by eliminating the
    'my_row' and 'my_col' elements.

    :param in_mat: list of lists i.e., a matrix
    :param my_row: int
    :param my_col: int
    :return: list of lists, i.e. a matrix
    """

    # use deepcopy to leave untouched the original matrix
    my_mat = copy.deepcopy(in_mat)

    my_mat.pop(my_row)  # remove the my_row first
    [col.pop(my_col) for col in my_mat]  # remove the my_col column

    return my_mat