PythonのTrue,False小メモ
Pythonの真偽値として使われるbool型に関するメモ
https://docs.python.jp/3/library/numbers.html#numbers.Integral
常識なのかもしれないが、bool型は整数型の派生型とのこと
>>> True True >>> type(True) <class 'bool'>
整数型の派生なので演算ができる
>>> True + 1 2 >>> True + True 2
おまけ
>>> True == True + True False
真実に真実を加えると、真実じゃなくなる