Why True/False is capitalized in Python?

后端 未结 4 1791
伪装坚强ぢ
伪装坚强ぢ 2020-12-24 10:05

All members are camel case, right? Why True/False but not true/false, which is more relaxed?

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-24 11:00

    In python only the 3 keywords True ,False and None are started with capital letters. I think This is to differentiate these 3 keywords from others. These 3 keywords can be used as literals or values where as other keywords not. For example

    a=True is correct but a=for is wrong

提交回复
热议问题