In Part IV, we study the Python
function—a package of code that can be called repeatedly, with
different inputs and outputs each time. We've
already been calling functions earlier in the book:
open, to make a file object, for instance. Here,
the emphasis will be on coding user-defined functions, which compute
values, perform part of a program's overall logic,
or otherwise wrap code for easy reuse.