10 Use classes to create active objects
What you will learn
From what we’ve learned up to now, we can regard a Python class as a way of designing objects that hold a set of data. We’ve seen that a program can add data attributes to a class instance so that it can assemble related items. We explored this by creating a class-based application that stores contact details. However, we know that we can use a class in any situation in which we want to gather some related information.
In this chapter, we’ll look at the other kind of class attribute: the method. We’ll discover how to create active objects that can manage the data they hold and provide ...
Get Begin to Code with Python 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.