Ones complement in Python

1’s complement of a binary number is another binary number obtained by toggling all bits in it, i.e., transforming the 0 bit to 1 and the 1 bit to 0. To calculate binary bitwise operator required in python. You can find the example of one's complement calculator using python in the given link.