This chapter introduces functions, a fundamental building block in programming. We show how to define them, how to handle input and output, how to properly use them, and how to treat them as objects.
The following topics are covered in this chapter:
- Functions in mathematics and functions in Python
- Parameters and arguments
- Return values
- Recursive functions
- Function documentation
- Functions are objects
- Anonymous functions – the keyword lambda
- Functions as decorators