Bitwise
<<
<<
shifts the bits of the left operand to the left by the number of bits specified by the right operand.
a = 2 # 00000010
b = 3
a << b # 00010000 or 16
>>
>>
shifts the bits of the left operand to the right by the number of bits specified by the right operand.
a = 2 # 00000010
b = 1
a >> b # 00000001 or 1
&
&
performs a bitwise AND operation on the two operands.
a = 2 # 00000100
b = 3 # 00000011
a & b # 00000000 or 0
|
|
performs a bitwise OR operation on the two operands.
a = 2 # 00000100
b = 3 # 00000011
a | b # 00000111 or 7