6.2 On None

Download notebook Interact

Python has a special value, called None, that it often uses to tell you that it cannot give you a valid value. Unlike any other common value in Python, if an expression evaluates to None, Python shows you nothing at all for the value, in the notebook, or in an interactive Python console.

my_value = None
my_value
# This next line is an expression, evalating to None
None

We can see if we got the value None by using the is comparison operator. Here is an expression, using the is operator, that evaluates to True.

my_value is None
True