A small number of constants live in the built-in namespace. They are:
False
The false value of the bool type. Assignments to False are illegal and raise a SyntaxError.
True
The true value of the bool type. Assignments to True are illegal and raise a SyntaxError.
None
The sole value of the type NoneType. None is frequently used to represent the absence of a value, as when default arguments are not
passed to a function. Assignments to None are illegal and raise a
SyntaxError.
This type has a single value. There is a single object with this value. This object is accessed through the built-in name None. It is
used to signify the absence of a value in many situations, e.g., it is
returned from functions that don’t explicitly return anything. Its
truth value is false.
以及
Booleans (bool)
These represent the truth values False and True. The two objects representing the values False and True are the only Boolean objects.
The Boolean type is a subtype of the integer type, and Boolean values
behave like the values 0 and 1, respectively, in almost all contexts,
the exception being that when converted to a string, the strings
"False" or "True" are returned, respectively.
Python Documentation拥有一切,你只需要知道在哪里找:
还有
以及
进一步阅读
相关问题 更多 >
编程相关推荐