StackOverflow 文档 Python Language 教程 按位运算符 按位 OR 按位 OR Created: November-22, 2018 |运算符将执行二进制或,如果某个位存在于任一操作数中,则复制该位。这意味着: # 0 | 0 = 0 # 0 | 1 = 1 # 1 | 0 = 1 # 1 | 1 = 1 # 60 = 0b111100 # 30 = 0b011110 60 | 30 # Out: 62 # 62 = 0b111110 bin(60 | 30) # Out: 0b111110 按位左移按位 AND