1#PYTHON BITWISE OPERATORS
2OPERATOR DESCRIPTION SYNTAX FUNCTION IN-PLACE METHOD
3& Bitwise AND a & b and_(a, b) __and__(self, other)
4| Bitwise OR a | b or_(a, b) __or__(self, other)
5^ Bitwise XOR a ^ b xor(a, b) __xor__(self, other)
6~ Bitwise NOT ~ a invert(a) __invert__(self)
7<< Bitwise L shift a << b lshift(a, b) __lshift__(self, other)
8>> Bitwise R shift a >> b rshift(a, b) __irshift__(self, other)
1OPERATOR DESCRIPTION SYNTAX
2& Bitwise AND x & y
3| Bitwise OR x | y
4~ Bitwise NOT ~x
5^ Bitwise XOR x ^ y
6>> Bitwise right shift x>>
7<< Bitwise left shift x<<