Back

Explore Courses Blog Tutorials Interview Questions
+3 votes
8 views
in Python by (3.5k points)
Can someone tell me how to refer a null object in Python?

2 Answers

0 votes
by (2k points)
edited by

None is defined for null object in Python and use is operator to check:

>>> foo is None
True
>>> foo = 'bar'
>>> foo is None
False

0 votes
by (106k points)
edited by

It's not called null as in other languages, but None. There is always only one instance of this object, so you can check for equivalence with x is None (identity comparison) instead of x == None, if you want.

You can use the following video tutorials to clear all your doubts:-

Be a Python Expert. Enroll in Python Programming Course by Intellipaat

Related questions

0 votes
1 answer
asked Sep 12, 2019 in Python by Sammy (47.6k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...