Aug-09-2018, 06:24 PM
When you define a method in a subclass which has the same name as the superclass, you replace that method in the subclass. So in this case you'd lose the
print("Animal created")
behavior by overriding the __init__ method. Explicitly calling the superclass __init__ method by that name retains the behavior, so that you have both behaviors. Normally, we use super() for that instead; this is useful in examples where the superclass changes, or there are other more complex situations.. What tutorial are you using, and what Python version?