None

KeywordPython 2.0+Beginner

Represents the absence of a value; Python's null equivalent

Quick Info

Documentation
Official Docs
Python Version
2.0+

Learn by Difficulty

Quick Example

python
x = None
print(x)
print(type(x))

# Always use 'is' to check for None
print(x is None)
print(x == None)  # works but 'is' is preferred

None is Python's null. Use 'is None' not '== None' because 'is' checks identity, which is both faster and safer.

Try in Playground

Tags

languagesyntaxcoredatatypenull

Related Items