Functions
Functions: Big Picture
- Explain how a function is similar to a data structure.
- State the benefits of writing and using functions in programming.
- Explain the relationship between mathematical functions and functions in the context of programming.
- State the three main components of a function.
Python Functions
- Write valid function definitions in Python.
- Call a function that you have defined.
- Distinguish between defining and calling a function.
- Given the specification of a function, its parameters, and its return values, write a Python function that meets those specifications.
Parameters and Arguments of Python Functions
- Define the following terms:
- parameter
- argument
- keyword argument
- positional argument
- Compare and contrast parameters and arguments for Python functions.
- State an analogy between parameters and arguments of functions and defining and evaluating a mathematical function.
- Call functions with both keyword and position arguments.
- Write functions with parameters that have default values.
Python Modules
- Create a Python module that includes function definitions.
- Import functions from a Python module you have created.
Documenting Functions
- Explain the rationale for including function documentation with a function.
- Write function documentation following the template provided in Lecture 16.
- Access function documentation using
?
.