Unit 9 · Lesson 3
Build the idea
Start with the concept and its key vocabulary.
A function produces a value for the rest of the program. ERL encloses it with function and endfunction; Python uses def. In both languages, return sends the result back to the call. Printing inside a function only displays something—it does not give the caller a value to store or reuse.
A sub-program that returns a value.
Send a value from a function back to the instruction that called it.
The result supplied by a completed function call.
Storing a value, including a returned value, in a variable.