糖糖糖糖糖丶 发表于 2017-12-29 15:54:53

and or not意义

0 和1代表什么
比如0 and 1 为什么和 1 and 2 不一样
还有not 1是什么意思。

冬雪雪冬 发表于 2017-12-29 16:27:51

and or not是逻辑运算符
True and True 为True
True and False 为False
False and False 为False

True or True 为True
True or False 为True
False or False 为False

not False 为True
not True 为False

在python中0,空字符串,空列表,空元组,空字典等为False,其他为True
页: [1]
查看完整版本: and or not意义