October 2019
Beginner to intermediate
498 pages
14h 13m
English
Planet ClassWe now turn our attention to solving the problem of building a model of the solar system. To do so will require that we 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