None (Python)

None is Python's special value that represents the absence of a value or 'nothing.' It is the object returned by functions that don't explicitly return anything.

Python

None is a singleton, so you should check for it with the identity operator: `if x is None`. It is Python's equivalent of null in other languages.

Examples

Python

result = None
if result is None:
    print("no value yet")

Output:

no value yet

See also

Back to the Dictionary