Run
a = 5 b = 2 print('a & b :', (a & b)) #bitwise AND print('a | b :', (a | b)) #bitwise OR print('a ^ b :', (a ^ b)) #bitwise XOR print(' ~ b :', (~ b)) #bitwise NOT print('a << b :', (a << b)) #bitwise Left Shift print('a >> b :', (a >> b)) #bitwise Right Shift
Output