Functions
Students will ...
- be able to describe the semantics of a function definition -- what a function definition is and what it is good for.
- know the proper syntax of a function definition, including the names of the various parts.
- be able to describe what arguments, parameters, and formal parameters are.
- be able to distinguish between a function definition and a function call.
- be able to define a function that returns a value to its caller (a fruitful function).
- understand that the return statement specifies the value to return to the function caller.
- know that a function that does not execute a return statement returns
None
.
- be able to describe what a variable's scope or lifetime is (i.e., for a local variable or parameter).
- be able to recognize and implement an accumulator pattern.
- be able to articulate the multiple benefits of defining functions.
- be able to trace the flow of execution of a series of function calls.