主页
Python
Python 运算符优先级
demo_precedence_and
运行 ❯
×
更改方向
保存代码
更改主题
print(1 or 2 and 3) """ The and operator has a higher precedence than or, and we need to calculate the and expression first. The calculation above reads: 1 or 3 = 1 """
1