首页 Python基础入门视频教程 Python运算符优先级顺序,Python运算符优先级由高到低排序
pay pay

Python运算符优先级顺序,Python运算符优先级由高到低排序

日期: 二月 14, 2023, 6:57 a.m.
阅读: 551
作者: Python自学网-村长

摘要: Python运算符优先级顺序,Python运算符优先级由高到低排序

算术运算符  》  位运算符  》  比较运算符  》  逻辑运算符

print(3 + 2 * 4)

print(13//3 > 157//5)

print(0 or 13//3)  # 4
print(13//3 and 14//2 < 157//5 or 13//3)  # True

返回结果

11
False
4
True

运算符优先级

原创视频,版权所有,未经允许,切勿转载,违者必究!
回顶部