♦ Bitwise Operators in Python
♣ Example7: Bitwise Operators in Python
Bitwise Operators in Python are used to compare numbers which are represented in Binary format.Operator@Working | |
---|---|
&@Outputs 1 if both bit's value is 1 | |
|@Outputs 1 if atleast one of bit's value is 1 | |
^@Outputs 1 if only one of bit's value is 1 | |
~@Reverses the bit value | |
<, | >>@Right Shift of 0s |
Example
Input:
Output: