April 2024
Beginner to intermediate
500 pages
24h 20m
English
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.
Read now
Unlock full access