if math.pi / 2 - (math.pi / 2 - 1.3) <= angle <= math.pi / 2 + (math.pi / 2 - 1.3) or math.pi / 2 * 3 - (math.pi / 2 - 1.3) <= angle <= math.pi / 2 * 3 + (math.pi / 2 - 1.3):
总体套路就两个:
1、优先级:() > not > and > or
2、同级执行方向:从左到右
从这个例子, 大概就是先算括号里的, 然后从左到右做算术运算, 再做 <= 运算, 最后做OR 运算
import math
angle = 4.5
print(math.pi / 2 * 3 - (math.pi / 2 - 1.3))
print(math.pi / 2 * 3 + (math.pi / 2 - 1.3))
print(math.pi / 2 - (math.pi / 2 - 1.3) <= angle <= math.pi / 2 + (math.pi / 2 - 1.3) )
print(math.pi / 2 * 3 - (math.pi / 2 - 1.3) <= angle <= math.pi / 2 * 3 + (math.pi / 2 - 1.3))
print( math.pi / 2 - (math.pi / 2 - 1.3) <= angle <= math.pi / 2 + (math.pi / 2 - 1.3) or math.pi / 2 * 3 - (math.pi / 2 - 1.3) <= angle <= math.pi / 2 * 3 + (math.pi / 2 - 1.3) )