关于多个运算符的问题
1<2==2 #代码运行结果是True
官方是这样解释的:
Unlike C, all comparison operations in Python have the same priority,which is lower than that of any arithmetic, shifting or bitwiseoperation.……
Comparisons can be chained arbitrarily, e.g.,
"x < y <= z" isequivalent to "x < y and y <= z",
Comparisons can be chained arbitrarily, e.g.,
"x < y <= z" isequivalent to "x < y and y <= z",
即把该运算拆成两个表达式进行与运算。