1、算术运算符------ + - * / % //


2、比较运算符------ > < >= <= != ==


3、赋值运算符------ = += -=

4、逻辑运算符------- and or not

这三个逻辑运算符一起时,优先级为:not>and>or

推荐菜鸟教程中关于逻辑运算符的测试题
x = True y = False z = False if not x or y: print(1) elif not x or not y and z: print(2) elif not x or y or not y and x: print(3) else: print(4) ------------------------------------------------------------------- 以上的结果输入为: A 1 B 2 C 3 D 4
5、成员运算符------- in not in


浙公网安备 33010602011771号