在Python里面 not"a" 为什么输出False

img

布尔表达式返回值 只有 True False
'a'是 True
not ‘a’就是False了

逻辑运算符的值只有Ture 和False
not 就是将结果取反。如果结果为True 用not取反后就是False


not    not x    布尔“非”。如果x为True,返回False
and    x and y    布尔“与”。都真才真,一假则假
or    x or y    布尔“或”。都假才假,一真则真