Python 按位赋值运算符中的竖线是什么?
pythonserver side programmingprogramming更新于 2025/8/13 16:44:17
竖线 (|) 代表按位或运算符。如果有两个整数对象,则返回两个整数的按位或运算
>>> a=4 >>> bin(a) '0b100' >>> b=5 >>> bin(b) '0b101' >>> a|b 5 >>> c=a|b >>> bin(c) '0b101'
相关文章
有用资源
python 参考教程 - 该教程包含有关 python 的更多信息:https://www.cainiaomax.com/python/

