What is Python's None value?
Answer
None in Python is a singleton object of type NoneType representing the absence of a value or a null result. It is Python's equivalent of null in other languages. Functions that do not explicitly return a value return None implicitly. Always check for None using is None or is not None — not == None (although it works, is is more Pythonic and slightly faster). None is falsy in boolean context: if not result catches None, but also 0, empty strings, empty lists, etc. Explicitly check: if result is None. Common uses: default parameter values (def func(data=None)), signaling "no result" from a function, and as a sentinel value in optional chaining logic.
Previous
What is the difference between range() and xrange() in Python?
Next
What are Python modules and packages?