Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

bitwise operators in python

# Examples of Bitwise operators
a = 10
b = 4
 
# Print bitwise AND operation
print(a & b)
 
# Print bitwise OR operation
print(a | b)
 
# Print bitwise NOT operation
print(~a)
 
# print bitwise XOR operation
print(a ^ b)
 
# print bitwise right shift operation
print(a >> 2)
 
# print bitwise left shift operation
print(a << 2)
Source by wiki.python.org #
 
PREVIOUS NEXT
Tagged: #bitwise #operators #python
ADD COMMENT
Topic
Name
1+5 =