python define a new class that is a modified version of an existing class
Inheritance is the ability to define a new class that is a modified version of an existing class. It is called âinheritanceâ because the new class inherits the methods of the existing class. Extending this metaphor, the existing class is called the parent and the new class is called the child. As an example, letâs say we want a class to represent a âhand,â that is, the set of cards held by one player.