Answer:
This is inheritance. Suppose there is a python program p1.py with class Person
And we want to use the method in Person in another program p2.py
We can import that class in p2 like
from p1 import Person
And now we can create an object of class Person in p2 and use any of the methods inside the Person.
The same thing can be done in c++. java, c#, swift and various other OOPS based programming languages.
Step-by-step explanation:
Please check the answer section.