binary function in python code example
Example 1: binary operation python
x << y
"left shifted x by y places"
x >> y
"right shift x by y places"
x & y
"bitwise and"
x | y
"bitwise or".
~ x
"Complement of x"
x ^ y
"bitwise exclusive or"
Example 2: python binary
num = 10
bin(num)
Example 3: python bin()
#Return the binary version of 36:
x = bin(36)