Label relationships between classes as types of inheritance.
Construct classes that form hierarchical inheritance.
Hierarchical inheritance basics
Hierarchical inheritance is a type of inheritance in which multiple classes inherit from a single superclass. Multilevel inheritance is a type of inheritance in which a subclass becomes the superclass for another class. Combining hierarchical and multilevel inheritance creates a tree-like organization of classes.
Implementing hierarchical inheritance
Multiple classes can inherit from a single class by simply including the superclass name in each subclass definition.
Adapted from Introduction to Python Programming by OpenStax (openstax.org), licensed under CC BY-NC-SA 4.0. Changes were made. License: CC-BY-NC-SA-4.0.