All members are camel case, right? Why True/False but not true/false, which is more relaxed?
In Python boolean builtins are capitalized, so True and False. You do not need to explicitly define the data type to boolean. You don't need to say “I want to use a boolean” as you would need in C or Java. Instead Python knows the variable is a boolean based on the value you assign.
They are True and False . Capitalization is important, since true and false are not boolean values (remember Python is case sensitive).
In Python, the capitalize() method returns a copy of the original string and converts the first character of the string to a capital (uppercase) letter while making all other characters in the string lowercase letters.
From Pep 285:
Should the constants be called 'True' and 'False' (similar to None) or 'true' and 'false' (as in C++, Java and C99)?
=> True and False.
Most reviewers agree that consistency within Python is more important than consistency with other languages.
This, as Andrew points out, is probably because all (most)? built-in constants are capitalized.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With