3.4. Functions#
Programming always consists in dividing complex problems into simpler ones. For that matter, all programming languages provide a way to group code into bundles named functions.
A function is a subprogram that optionally takes some input, performs a given list of operations on it, and optionally returns the result as an output. The following sections will introduce how to define and document functions in Python.