0 votes
in Python by
Explain Inheritance and its various types in Python?

1 Answer

0 votes
by

Inheritance enables a class to acquire all the members of another class. These members can be attributes, methods, or both. By providing reusability, inheritance makes it easier to create as well as maintain an application.

The class which acquires is known as the child class or the derived class. The one that it acquires from is known as the superclass or base class or the parent class. There are 4 forms of inheritance supported by Python:

  1. Single Inheritance – A single derived class acquires from on single superclass.
  2. Multi-Level Inheritance – At least 2 different derived classes acquire from two distinct base classes.
  3. Hierarchical Inheritance – A number of child classes acquire from one superclass
  4. Multiple Inheritance – A derived class acquires from several superclasses.

Related questions

+1 vote
asked Feb 1, 2023 in JAVA by sharadyadav1986
0 votes
asked Feb 8, 2021 in JAVA by SakshiSharma
...