def toggle_bits(S, *positions):
    """
    Returns a new set from set `S` with bits toggled (flip the status of) in the given `positions`.

    Examples
    ========

    Toggle the 2-nd item and then 3-rd item of the set
    >>> S = int('0b101000', base=2)
    >>> S = toggle_bits(S, 2, 3)
    >>> bin(S)
    '0b100100'

    """
    for j in positions:
        S = S ^ (1 << j)

    return S