Good job! Now that you know the basics, we will introduce some more advanced concepts related to functions.
To start with, it is possible to provide default values for function parameters. Take a look at a function that converts a dog age to a human age (one dog year equals around seven human years):
Note what we did: in the parentheses, we provided a default value for the
dog_age parameter (
dog_age=1). This means that we can choose to provide no value for this parameter when we invoke the function. In that case the function will simply work with the default value of 1. If we choose to pass in our own value for
dog_age, the function will use that new value.