Embedded software for General Dynamics Mission Systems mission computers often updates individual control or status bits in a hardware register. Write a function that toggles exactly one bit without changing any other bit in the register.
Implement toggle_bit(register, bit_position).
register is an unsigned 32-bit integer.bit_position is an integer from 0 through 31, where position 0 is the least significant bit.bit_position must remain unchanged.Use bitwise operations rather than converting the register to a string or modifying individual decimal digits.
def toggle_bit(register, bit_position):