布爾值有兩種類型:True 和 False
1.(不能更改的特性)開頭字母大寫,后面的都是小寫
2.布爾值可以用在表達(dá)式中,可以保存在變量中
>>> spam = True
3.大小寫不正確會報錯
>>> true #大小寫不正確 會報錯
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
true
NameError: name 'true' is not defined
4.將True和False作為變量會報錯
>>> True = 2 + 2
SyntaxError: can't assign to keyword