not or and 的优先级是不同的: not > and > or
请用最快速度说出答案: not 1 or 0 and 1 or 3 and 4 or 5 and 6 or 7 and 8 and 9
(not 1) or (0 and 1) or (3 and 4) or (5 and 6) or (7 and 8 and 9)
== 0 or 0 or 4 or 6 or 9 == 4
短路逻辑”: 3 and 4 == 4 ,而 3 or 4 == 3。
not or and 的优先级是不同的: not > and > or
请用最快速度说出答案: not 1 or 0 and 1 or 3 and 4 or 5 and 6 or 7 and 8 and 9
(not 1) or (0 and 1) or (3 and 4) or (5 and 6) or (7 and 8 and 9)
== 0 or 0 or 4 or 6 or 9 == 4
短路逻辑”: 3 and 4 == 4 ,而 3 or 4 == 3。
转载于:https://www.cnblogs.com/huashu2019/p/11260996.html