Chapter 4 - Creating Functions Flashcards
What are the parameters of a function?
The variables that the function uses to refer to the arguments it is given in a call to that function.
What are the differences between arguments and parameters?
What does the return statement do?
As soon as its executed, not matter where it is in the function, execution of the function immediately ceases, the value of the accompanying expression is returned, and execution continues from the line immediately after the call that invoked the function.
What is a docstring?
documents what inputs and outputs are.
What information should a docstring contain?
What the function does, what each parameter is for, the expected data type of the argument to that parameter, and what the function returns (if anything).
What is generalization?
The process of modifying a function/algorithm that solves a specific problem so that it can solve a wider range of problems, or a larger number of instances of the same problem.