主页
Python
Python 运算符优先级
demo_precedence_same
运行 ❯
×
更改方向
保存代码
更改主题
print(5 + 4 - 7 + 3) """ Additions and subtractions have the same precedence, and we need to calculate from left to right. The calculation above reads: 5 + 4 = 9 9 - 7 = 2 2 + 3 = 5 """
5