MWZ

MINDWAREZONE

Bitwise Operators in python

Bitwise operators work with binary numbers.

Operator Description
& AND
| OR
^ XOR
~ NOT
<< Left Shift
>> Right Shift

Example

a = 5 
b = 3 

print(a & b) 
print(a | b)
            

Output:

1 
7