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. ...

Get Core Python 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.