Skip to content

None

In one line

None is Python's null value — a singleton representing the absence of a value.

In simple words

None is Python's representation of "no value" or "nothing." It is a singleton — there is only one None object in all of Python. Use is None or is not None to test for it, not == None.

None is returned by functions that don't have a return statement, and by methods like list.append() that modify in place. It is commonly used as a default argument value to distinguish "not provided" from "provided as falsy."

None is falsy in boolean contexts. It has no type methods. Its type is NoneType. It cannot be used in arithmetic or compared with < or >.

Example

python
x = None

print(x is None)      # True
print(type(x))       # <class 'NoneType'>

# Functions without return return None
def greet(name):
    print(f"Hi, {name}")

result = greet("Alice")  # Prints: Hi, Alice
print(result)            # None

# None as default argument
def func(items=None):
    if items is None:
        items = []
    return items

None represents absence of value. Test with 'is None'. Functions without return give None.

Common confusions

  • Confused with: False

    The difference: None means 'no value at all'. False is a boolean value meaning 'not true'. None is NoneType; False is bool. Both are falsy, but they are different objects: None == False is False.

Related terms

Related Resources

Related Lessons

Decode error messages

Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.

View errors

← Back to glossary