Methods to Check with a Null Object in Python
If you must consult with a Null Object in your Python code, then you are able to do the next.
It is very important observe that Python doesn’t have a Null
kind, as an alternative Python refers to not set objects or variables as None
.
We will use the is
key phrase to test if an object or variable has the kind of None
.
object_name = None
print(object_name is None)
object_name = ' some_value'
print(object_name is None)