#python #python3 #pytoncourse #inheritance
@kingoftechniques6864
Inheritance is the capability of one class to derive or inherit the properties from another class. The benefits of inheritance are:
It represents real-world relationships well.
It provides reusability of a code. We don’t have to write the same code again and again. Also, it allows us to add more features to a class without modifying it.
It is transitive in nature, which means that if class B inherits from another class A, then all the subclasses of B would automatically inherit from class A.