前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Python中的一些基础: 真值表

Python中的一些基础: 真值表

作者头像
py3study
发布2020-01-09 16:10:15
8040
发布2020-01-09 16:10:15
举报
文章被收录于专栏:python3

为了便于看清,我用<=>来表示等价关系。 <=>左边表示逻辑表达式,<=>右边表示它的结果。

NOT not False <=> True not True <=> False (not的结果与原值相反) OR True or False <=> True True or True <=> True False or True <=> True False or False <=> False (只要有一个值为True,OR的结果就是True) AND True and False <=> False True and True <=> True False and True <=> False False and False <=> False (只要有一个值为False,AND的结果就是False) NOT OR not (True or False) <=> False not (True or True) <=> False not (False or True) <=> False not (False or False) <=> True NOT AND not (True and False) <=> True not (True and True) <=> False not (False and True) <=> True not (False and False) <=> True != 1 != 0 <=> True 1 != 1 <=> False 0 != 1 <=> True 0 != 0 <=> False == 1 == 0 <=> False 1 == 1 <=> True 0 == 1 <=> False 0 == 0 <=> True

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2019/08/25 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档