Chapter 18

Functions are at Your Beck and Call

Learning Objectives

Upon completing all the content in this chapter, you should be able to do the following:

  1. Write a function in Python
  2. Be able to set default values for function parameters

Key Terminology

Here is a list of key terms for this chapter, broken up by the page upon which the term first appears. Make note of each term as its definition.

Introduction

  1. function
  2. encapsulation
  3. function machine

Calling Functions

  1. Function call
  2. arguments

Defining Our Own Functions

  1. def
  2. function name
  3. parameter
  4. function body

Function Output

  1. return statement
  2. boolean function

Parameters and Variables

  1. scope
  2. shadowing