A lot of times, we need to check if a value is null. In Python, there is no Null, instead it has None.
To check if a value is Null, we check if a value is None or not.
We use is operator to do the comparision. You can use == also, however, since the operation "is" is defined as the object identity operation, it is probably more correct to use it, rather than "==".
Syntax to check Noneness of an object is like this:
>>> foo is None True >>> foo = 'bar' >>> foo is None False >>> foo not None True
None is the sole instance of the class NoneType.
None returns False, when converted to bool.
>>> bool(None) False >>> not None True