Python Lessons – 7.2 Inheritance

Python Lessons - 7.2 Inheritance m

Inheritance provides a way to share functionality between different classes. Let's think of different classes like triangle, Square, Pentagon. These classes differ in some respects but also have other aspects that unite them (e.g. color, area, etc.). So it could be assumed that there is a superclass that has all the characteristics that all the common.

Continue reading

Python Lessons – 7.5 Data Hiding

Python lessons - 7.5 Data Hiding m

One of the key parts of object programming is encapsulation, which involves packaging variables and related functions into a single, simple-to-use object: the instance of a class. A concept related to this is data hiding, which is to hide the implementation details of a class. In this way the user interface of this class is clean and more intushable.

Continue reading