Bit calculation: shift left : Bit « Data Type « Python






Bit calculation: shift left

Bit calculation: shift left

x = 1        # 0001
x << 2       # shift left 2 bits: 0100
print x
           
       








Related examples in the same category

1.Bitwise orBitwise or
2.bitwise ANDbitwise AND