10.7 Summary
In this chapter, we explored the implementation of our own data types by creating classes. The programmer can take advantage of this ability to create solutions using a data model that closely resembles the problem domain. Classes provide a description of objects (instances of classes) by defining data and methods. Objects are created by calling the constructor method.
Other methods, both accessors and mutators, allow the programmer to communicate with individual objects. We also introduced a number of special methods defined by Python, which in some cases are bound to operators. Finally, we used the Turtle to implement a graphical simulation of planetary movement.
Key Terms
acceleration
accessor method
class
class definition ...
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