functions

A function is a callable unit/block of code. It is a way to write statements that can be used to accomplish a task at a different time from when they are written. Using functions makes the code smaller and easier to read, test, reuse, maintain and improve.

Programming involves providing a process with input data and the process returning output data

argument -> program -> output_data

Which is like mathematics where a function is represented as f with inputs x and an output of y

\[f(x) -> y\]

in other words

program(argument) -> output_data

program is the function that carries out the processing of argument to return output_data

functions are defined using the def keyword, a name, parentheses and a colon at the end

The following tests cover different ways to make a function