Subclassing and override
A subclass declares a new class based on another. class Puppy(Dog): says "a Puppy is a kind of Dog". The subclass inherits every attribute and method that the parent defined.
If you define a method in the subclass with the same name as one in the parent, the subclass version wins. This is called overriding. The instance still has access to the rest of the parent's methods, just not the one that got replaced.
Use inheritance to express "is a" relationships, where the subclass is genuinely a specialized version of the parent. Avoid using it for code reuse alone; composition (one object owning another) usually works better when the relationship is "has a".