Lesson 3
Discovering your Paths
Chapter 6: Function calls
Calling functions
Think of a coffee machine. You give it some input (coffee beans, water) and press a button. The output is some freshly brewed coffee. You do not need to know how it works inside. You only need to know that the coffee machine makes you fresh coffee if you provide it with some coffee beans and water.
Similarly, to call (use) a function, you will only need to know:
- Its name
- What the function does (at a high level), for example “compute the absolute value”
- What inputs (arguments) the function can take
- What output does the function return
Here is a quick quiz to test your understanding.
The quiz uses the Python built-in function abs()
which takes a number and returns the absolute value of the given number.
❮
❯