In this lesson
- It starts with a question. A function prints a total but does not return it. Can another part of the program use that total?
- The idea you will find. return ends the function and hands a value back. — Nothing after a return runs. A function with no return hands back None, which is why a program sometimes fails with "unsupported operand" a few lines later — the real mistake was a missing return further up.
- Length. 5 short steps. Progress saves on this phone.
Part of Python: Functions That Return
Writing functions that give you something back — and knowing what happens if they do not.