4.9. Exercises
4-1. Python Objects. What three values are associated with all Python objects?
4-2. Types. Which Python types are immutable?
4-3. Types. Which Python types are sequences?
4-4. type() Built-in Function. What does the type() built-in function do? What kind of object does type() return—an integer or an object?
4-5. str() and repr() Built-in Functions. What are the differences between the str() and repr() built-in functions and the backquote ( `` ) operator?
4-6. Object Equality. What do you think is the difference between the expressions type(a) == type(b) and type(a) is type(b)?
4-7. dir() Built-in Function. In Exercises 2-12 and 2-13, we experimented with a built-in function called dir() which takes an object and reveals its attributes. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access