Open wilkice opened 5 years ago
change Python Integer to 0b Bitwise OR | 1 | 0 = 0 | 1 = 1 | 1 = 1 0 | 0 = 0 1010 | 0100 = 0000 Bitwise XOR ^ 1 ^ 0 = 1 0 ^ 0 = 0 1 ^ 1 = 0 0 ^ 1 = 1 1010 ^ 0100 = 1110 Bitwise AND & 1 & 0 = 0 & 1 = 0 & 0 = 0 1 & 1 = 1 Usage: Single Number Reference: Python 位操作(Bitwise Operation) 详解 Basic Operators in Python
change Python Integer to 0b
0b
|
1 | 0 = 0 | 1 = 1 | 1 = 1 0 | 0 = 0 1010 | 0100 = 0000
^
1 ^ 0 = 1 0 ^ 0 = 0 1 ^ 1 = 0 0 ^ 1 = 1 1010 ^ 0100 = 1110
&
1 & 0 = 0 & 1 = 0 & 0 = 0 1 & 1 = 1
Bitwise