If it’s worthwhile to confer 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
sort, as a substitute Python refers to not set objects or variables as None
.
We are able to use the is
key phrase to verify 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)