11. What’s Your Function

  1. 11.1. Introduction
    1. 11.1.1. Check Your Understanding
  2. 11.2. Calling Functions
    1. 11.2.1. Making a Function Run
  3. 11.3. Defining Our Own Functions
    1. 11.3.1. Function Syntax
      1. 11.3.1.1. Naming Functions
    2. 11.3.2. Function Code
    3. 11.3.3. Defining vs. Calling
    4. 11.3.4. Check Your Understanding
  4. 11.4. Function Input
    1. 11.4.1. Arguments and Parameters
    2. 11.4.2. Mismatched Arguments and Parameters
    3. 11.4.3. Default Parameter Values
    4. 11.4.4. Check Your Understanding
  5. 11.5. Function Output
    1. 11.5.1. Return Statements
      1. 11.5.1.1. Returning a Value
      2. 11.5.1.2. return Terminates Function Execution
      3. 11.5.1.3. Boolean Functions
    2. 11.5.2. Check Your Understanding
  6. 11.6. A Good Function-Writing Process
    1. 11.6.1. Step 1: Design Your Function
    2. 11.6.2. Step 2: Create the Basic Structure
    3. 11.6.3. Step 3: Write the Body
  7. 11.7. Parameters and Variables
    1. 11.7.1. Function Scope
    2. 11.7.2. Variable Shadowing
    3. 11.7.3. Check Your Understanding
  8. 11.8. Functions Calling Other Functions
    1. 11.8.1. Functions Should Do Exactly One Thing
  9. 11.9. Why Create Functions?
    1. 11.9.1. Functions Reduce Repetition
    2. 11.9.2. Functions Make Your Code More Readable
    3. 11.9.3. Functions Reduce Complexity
    4. 11.9.4. Functions Enable Code Sharing
    5. 11.9.5. Functions Save Millions of Lives Every Day
  10. 11.10. Exercises: Functions
    1. 11.10.1. Getting Started
    2. 11.10.2. Part 1: Rectangles
    3. 11.10.3. Part 2: Triangles
    4. 11.10.4. Part 3: Diamonds
    5. 11.10.5. Optional Mission
    6. 11.10.6. Submitting Your Work
  11. 11.11. Studio: Functions
    1. 11.11.1. Before You Start
    2. 11.11.2. Reverse Characters
    3. 11.11.3. Reverse Digits
    4. 11.11.4. Complete Reversal
    5. 11.11.5. Bonus Missions
    6. 11.11.6. Submitting Your Work