def toggle_nth_bit(n: int, i: int) -> int:
    """
    Toggle the n-th bit.

    >>> bin(toggle_nth_bit(0b10000001, 0))
    '0b10000000'
    >>> bin(toggle_nth_bit(0b10000001, 3))
    '0b10001001'
    """
    return n ^ (1 << i)