Module 4 · Function return · Lesson 2 of 4
The None value
Every function call produces a result — even one that doesn't look like it returns anything. When a function reaches its end without a return value, Python quietly hands back a special value called None: the official “nothing here.”
x = log("hi")def log(msg):
print(msg) # no return statement
effect (on screen)
hi
result (handed back)
None
This is exactly why print() has an effect (text on screen) but its result is None — and why x = print("hi") leaves x holding nothing useful. Seeing None where you expected a value almost always means a function did its work but forgot to return the answer.
Run it yourselfruns in your browser · Python
main.py
None isn't an error — it's a genuine value you can store, pass around, and check for. The usual test is is None (not == None), which reads naturally and is the Pythonic way to ask “did I get nothing?”