Inheritance by the word means to recieve something. In Python as well, inheritance has a similar meaning; it means class A defined on class B has all the properties of class B.
Inheritance helps in the code reusability. Just like a child inherits their parents' qualities, the class that inherits properties is known as a child class, and the class from which it inherits the properties is called the parent class. Let's take a look at an example to understand this better.
In the example shown above, you saw that the rectangle and circle inherit the properties of the parent class shape, and because of this parent-child relationship, you didn’t need to define set_colour and colour_the_shape again in the circle and rectangle classes.
One more thing to notice is the method calculate area since it would be unique to different classes it was just initiated in the parent class and in the child class, this method was defined as per the child class functionality. This is nothing but method overriding.
If you want to learn more about inheritance then click on the link given below: