13. Classes and ObjectsΒΆ

  1. 13.1. What are Objects
    1. 13.1.1. Examples of Objects
    2. 13.1.2. Objects Organize Related Code
    3. 13.1.3. Check Your Understanding
  2. 13.2. Why Use Objects?
    1. 13.2.1. A Shift in Thinking
    2. 13.2.2. Objects Copy Real World Thinking
      1. 13.2.2.1. Phones as Objects
      2. 13.2.2.2. Cooking with Objects
    3. 13.2.3. Check Your Understanding
  3. 13.3. Working With Objects
    1. 13.3.1. Object Properties
    2. 13.3.2. Calling Methods
    3. 13.3.3. Methods vs. Functions
      1. 13.3.3.1. Call Syntax
      2. 13.3.3.2. Methods are Object Specific
      3. 13.3.3.3. Try It!
  4. 13.4. Classes
    1. 13.4.1. Objects Have a Data Type
    2. 13.4.2. User Defined Classes
  5. 13.5. Create a Class
    1. 13.5.1. What Classes Do
    2. 13.5.2. Design a New Class
    3. 13.5.3. Define the New Class
      1. 13.5.3.1. Setting Property Values
    4. 13.5.4. Use Parameters with __init__
    5. 13.5.5. Check Your Understanding
  6. 13.6. Using a Class
    1. 13.6.1. Create New Objects
      1. 13.6.1.1. Default Property Values
    2. 13.6.2. Another Mental Image for Classes
  7. 13.7. Adding Methods to a Class
    1. 13.7.1. Return to the Class Design
    2. 13.7.2. Define a New Method
    3. 13.7.3. Add a Method to the Cat Class
    4. 13.7.4. Return Values
    5. 13.7.5. Add Your Own Method
    6. 13.7.6. Improving make_noise()
    7. 13.7.7. Check Your Understanding
  8. 13.8. More Object Details
    1. 13.8.1. Printing Objects
      1. 13.8.1.1. The __str__ Method
    2. 13.8.2. Collect All Property Values
      1. 13.8.2.1. Property and Method Names
  9. 13.9. Using Objects in Functions
    1. 13.9.1. Object Scope
    2. 13.9.2. Check Your Understanding
  10. 13.10. Inheritance and Other Topics
  11. 13.11. Exercises: Classes and Objects
    1. 13.11.1. Part 1: Create a New Class
      1. 13.11.1.1. Add Properties to Robot
      2. 13.11.1.2. Add Methods to Robot
    2. 13.11.2. Part 2: Create Objects
      1. 13.11.2.1. Update Distances
    3. 13.11.3. Part 3: Find Oldest Robot
    4. 13.11.4. Part 4: Robot Races
  12. 13.12. Project: Classes and Objects
    1. 13.12.1. Before You Start
    2. 13.12.2. Part 1: Add Class Properties and __str__ Method
    3. 13.12.3. Part 2: Add Another Class Method
    4. 13.12.4. Part 3: Add More Methods
      1. 13.12.4.1. Calculating the Test Average
      2. 13.12.4.2. Determining Candidate Status
    5. 13.12.5. Part 4: Play a Bit