Object-Based Programming

It is important to know Object-Oriented Analysis, Design and Programming as this allows the programmer to find solutions to complex problems relatively easily.

Chapter 13 of the book explains how classes, objects (instances), attributes and methods are used in Python. Chapter 14 distinguishes between immutable classes and mutable classes. Chapter 15 examines methods, including the initialization methods (called a constructor in other programming languages). Chapter 16 is about collections of objects.

Work to do:

We are now going to develop a race simulation program. Here is a statement describing the simulation:

A race has cars and drivers. Each car has a maximum speed and each driver has his own ability. A driver is assigned to a car randomly. The driver who has the best ability wins and, if there are many such drivers, the one driving the fastest car wins.

From the above statement and using object-oriented analysis, design and programming, implement a solution to this simulation problem using Python.