Inheritance in Python

Learn about the usability of inheritance in Python.

We'll cover the following

Inheritance

In inheritance, a new class called the derived class can be created to inherit features of an existing class called the base class.

The base class is also called the super or parent class.

The derived class is also called the sub or child class.

Coding examples

In the following program, Index is the base class and NewIndex is the derived class. Note the definition of the NewIndex class. The mention of Index within parentheses indicates that NewIndex is being inherited from the Index class.

Get hands-on with 1200+ tech skills courses.