生活随笔
收集整理的這篇文章主要介紹了
python 中的真值表
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
邏輯術語
and :與or:或not :非!=:不等于==:等于 =:大于等于
<=:小于等于True:真False:假
not真假
| not False | True |
| not True | False |
or真假
| True or False | True |
| True or True | True |
| False or True | True |
| False or False | False |
Ps:有一真則真
and真假
| True and False | False |
| True and True | True |
| False and True | False |
| False and False | False |
Ps: 同為真才真
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!=1 | False |
| 1!=0 | True |
| 0!=1 | True |
| 0!=0 | False |
==真假
| .0==1 | False |
| 0==0 | True |
| 1==1 | True |
| 1==0 | False |
總結
以上是生活随笔為你收集整理的python 中的真值表的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。