I think function should be def. because def is a reserved keyword.
9.2. Defining functions
function is our first Python keyword. Keywords are words that have a special meaning in a given programming language. Notice how a colon : precedes what is known as a block of code and constitutes the body of the function. It is required in Python to indent such blocks of code with the same number of spaces at the beginning of each line which, as a side-effect, makes it easy to identify the function body for a human reader.
This is a mistake; the very first tutorial I wrote for this version was for Javascript (it still exists somewhere) and I used it as a template for the first Python tutorial. I will fix this.
I think function should be def. because def is a reserved keyword.
9.2. Defining functions function is our first Python keyword. Keywords are words that have a special meaning in a given programming language. Notice how a colon : precedes what is known as a block of code and constitutes the body of the function. It is required in Python to indent such blocks of code with the same number of spaces at the beginning of each line which, as a side-effect, makes it easy to identify the function body for a human reader.