Python 运算符

运算符优先级,具体可以查文档

# and 优先级高于or
result = 1 or 2 and 3
print(result) # 1

关系运算符连写

#相当于 1 < 2 and 2 < 3
result = 1 < 2 < 3
print(result) #True
原文地址:https://www.cnblogs.com/noyouth/p/13526436.html