is a group of statements that together do a particular task. Functions help to organize, reuse, and clarify our code.
keyword marks the beginning of a function definition
is the name of the function, which must be unique within the program
is the function’s parameter; functions can have any number of parameters (including none)
the indented statements are the body of the function
After you define a function, you can use it by calling it, which requires the function name with the correct number of parameters.
statement is reached when evaluating a function, then the function ends. Optionally, the
statement can specify an expression.
In the example above,
is specifying the variable
as its return expression. When the
function is called, it will evaluate to that return expression.
If there’s no return expression, then the function call will return
print("Depositing $" + str(amount))