Sunday, April 14, 2024
HomeSoftware EngineeringThe way to Confer with a Null Object in Python

The way to Confer with a Null Object in Python


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)
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments