In object-oriented programming we break a large and potentially complex program into a set of interacting elements, or objects. The idea originates from modeling (in software) real-world entities such as electrons, people, buildings, or solar systems and readily extends to modeling abstract entities such as bits, numbers, colors, images, or programs.
As discussed in Section 1.2, a data type is a set of values and a set of operations defined on those values. In Python, the values and operations for many data types such as int
and float
are predefined. In object-oriented programming, we compose code to define new data types.
This ability to define new data types and to manipulate objects holding data-type values is also known as data abstraction, and leads us to a style of modular programming that naturally extends the function abstraction style that was the basis for Chapter 2. A data type allows us to isolate data as well as functions.
Below is a list of Python programs and data files used in this chapter.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4