Back

Explore Courses Blog Tutorials Interview Questions
+3 votes
7 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)

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:-

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
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94k users

Browse Categories

...