x = 5
x |= 3 #which is similar to x = x | 3
print(x)
回答:7
它是如何工作的?
The binary of 5 is : 0 1 0 1
The binary of 3 is : 0 0 1 1
OR operation : (If one of both sides are 1/True then result is 1/True)
0 1 0 1 #Binary of 5
0 0 1 1 #Binary of 3
---------------------
0 1 1 1 #Binary of 7