Functions

Functions: Big Picture

  1. Explain how a function is similar to a data structure.
  2. State the benefits of writing and using functions in programming.
  3. Explain the relationship between mathematical functions and functions in the context of programming.
  4. State the three main components of a function.

Python Functions

  1. Write valid function definitions in Python.
  2. Call a function that you have defined.
  3. Distinguish between defining and calling a function.
  4. 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

  1. Define the following terms:
  2. Compare and contrast parameters and arguments for Python functions.
  3. State an analogy between parameters and arguments of functions and defining and evaluating a mathematical function.
  4. Call functions with both keyword and position arguments.
  5. Write functions with parameters that have default values.

Python Modules

  1. Create a Python module that includes function definitions.
  2. Import functions from a Python module you have created.

Documenting Functions

  1. Explain the rationale for including function documentation with a function.
  2. Write function documentation following the template provided in Lecture 16.
  3. Access function documentation using ?.