Why would you want to inherit a class for another class in Python?

Experience Level: Junior
Tags: Python

Answer

You inherit one class for another class when you want the new class have same or similar methods as the original class together with some some new methods that define additional behavior of the class.

Inheritance is a concept of object oriented programming (OOP).

Python for beginners
Python for beginners

Are you learning Python ? Try our test we designed to help you progress faster.

Test yourself