
上QQ阅读APP看书,第一时间看更新
None
Python has a special null value called None, spelled with a capital N. None is frequently used to represent the absence of a value. The Python REPL never prints None results, so typing None into the REPL has no effect:
>>> None
>>>
The null value None can be bound to variable names just like any other object:
>>> a = None
and we can test whether an object is None by using Python's is operator:
>>> a is None
True
We can see here that the response is True, which brings us conveniently on to the bool type.