Write a Pytnon Program for Python Bitwise operators Program.
Theory
Python bitwise operators to manipulate individual bits.
Bitwise Operators are Bitwise AND, Bitwise OR, Bitwise XOR, Bitwise NOT, Bitwise left shift, Bitwise right shift
Operator Example Meaning
& a & b Bitwise AND
| a | b Bitwise OR
^ a ^ b Bitwise XOR (exclusive OR)
~ ~a Bitwise NOT
<< a << n times Bitwise left shift
>> a >> n times Bitwise right shift
Program Code
Input:
x=3
Enter the first number:1
Enter the second number:1
Output:
Logical NOT Operator Value: False
Logical OR Operator Value: True
Logical AND Operator Value: False
Logical Left Shoft Operator Value: 12
Logical Left Shoft Operator Value: 0
Logical compliment Operator Value: -4
Enter the first number:1
Enter the second number:1
Exclusive Or : 0
And Operator : 0