一、成员运算
1.返回布尔值 in
path = '/Users/zhangyu/PyCode/FluentPython' name = "zhangyu"
print(name not in path)
二、逻辑运算
python中逻辑假包括:
(1)False
(2)None
(3)0
(4)’’,即空字符串
(5)(),即空元组
(6)[],即空列表
(7){},即空字典
除了以上7种等为假,而其余任何值都视为真
1.返回布尔值
and & or & not 运算符等级从高到低
assert 0 and “5” and 55
因为是and,所以是FALSE
assert 0 or “5” and 55
运行结果:
TRUE 因为是or运算符,一个满足即可