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