leafleafleafDocy banner shape 01Docy banner shape 02Man illustrationFlower illustration

Custom Functions – Chapter 6

Estimated reading: 1 minute 15 views

This chapter focuses on Python custom functions, which allow us to reuse specific blocks of code. Functions can do different things depending on the parameters passed, we can call the function in code and get its return value.

Functions also allow us to give a given piece of code a meaningful name. For example, the function name pickRandomNumber makes it clear that all this function does is pick a number at random.