def clear_end(line: str, chars: list):
    """
    Clears line's end from unwanted chars.

    Parameters
    ----------
    line : str
        Line to be cleared.
    chars : list of chars
        Unwanted chars.

    Returns
    -------
    line : str
        Given line, cleared from unwanted chars.

    """
    while any(line.endswith(char) for char in chars):
        line = line[:-1]
    return line