python运算符
1. 运算符
+ - * / ** % //
判断某个东西是否在某个东西里面包含
in not in
结果:布尔值
True 真
False 假
==
>
<
>=
<=
!= 不等于
<> 不等于
v = user == 'alex' and pwd == "123" or 1 == 1
v = user == 'alex' or pwd == "123"
v = not False
补充:
user == 'alex' and (pwd == "123" or 1 == 1)先计算括号里面的
注意:
布尔值:
True or ==> True
True and ==> 继续走
False or ==> 继续走
False and ==> Flase
结果是值
算术运算
a = 10 * 10
赋值运算
a = a + 1
结果是布尔值
比较运算
a = 1 > 5
逻辑运算
a = 1 > 6 or 1 == 1
成员运算
a = '问' in ‘郑建文’