fork download
  1. # Python Bitwise Operator
  2. a=int(input())
  3. b=int(input())
  4. print("Bitwise AND ",a&b)
  5. print("Bitwise OR",a|b)
  6. print("Bitwise XOR",a^b)
  7. print("Bitwise Not",~a)
  8. print("Bitwise Left Shift 1:",a<<1)
  9. print("Bitwise Right Shift 1:",a>>1)
Success #stdin #stdout 0.02s 9292KB
stdin
4
2
stdout
Bitwise AND  0
Bitwise OR 6
Bitwise XOR 6
Bitwise Not -5
Bitwise Left Shift 1: 8
Bitwise Right Shift 1: 2