Python supports inheriting data and methods from other classes. This can help us to avoid rewriting common functionalities across multiple classes.
In our example above, Phone
is the parent class and IPhone
and AndroidPhone
are child classes that inherit from the Phone class. They are able to use the .call()
method from the Phone
class due to inheritance.