April 2024
Beginner to intermediate
500 pages
24h 20m
English
We now turn our attention to solving the problem of building a software model of the solar system. To do so, we need to consider the specific data used in the model. Even with the rich set of built-in classes provided by Python, it is often preferable to describe our problem and solution in terms of classes that are specifically designed to represent the objects in the problem. We begin by building a simple representation of a planet; we will then design and implement a Planet class.
To design a class to represent the idea of a planet, we need to consider the data the planet objects will need to know about themselves—that is, their instance data. The values of the instance data will help to differentiate ...
Read now
Unlock full access