Lesson 5. Object types and statements of code
After reading lesson 5, you’ll be able to
- Write code that creates various types of objects
- Write simple lines of code to manipulate Python variables
Suppose you have a family as follows:
- Four people—Alice, Bob, Charlotte, and David
- Three cats—Priss, Mint, and Jinx
- Two dogs—Rover and Zap
Every person, cat, and dog is a separate object. You named each object something different so you can easily refer to them and so that everyone else knows which object you’re talking about. In this family, you have three types of objects: people, cats, and dogs.
Each type of object has characteristics that are different from another type. People have hands and feet, whereas cats and dogs have only feet. Cats ...
Get Get Programming now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.