None value

Python's special value meaning nothing here, which is what a function returns if it has no return statement.

In more detail

Seeing None printed where you expected a result usually means you printed the result of a function that prints instead of returning. None is falsy, and you test for it with is None. Type hints write optional values as str | None.

Example

result = print("hi")
print(result)   # None

Related terms

Taught in

References

Certification courses