Understanding Python super() with __init__() methods [duplicate]

This question already has answers here: What does ‘super’ do in Python? – difference between super().__init__() and explicit superclass __init__() (11 answers) Closed 6 years ago. Why is super() used? Is there a difference between using Base.__init__ and super().__init__? class Base(object): def __init__(self): print “Base created” class ChildA(Base): def __init__(self): Base.__init__(self) class ChildB(Base): def __init__(self): … Read more

(The Triangle class) Design a class named Triangle that extends GeometricObject

You need to create a new Triangle object like this, so that you have a reference Trangle triangle = new Triangle(side1, side2, side3); // ^^^^^^ This is the most important thing you’re missing. You need a reference // point for your object. That’s the only way you can access it’s // properties. You also need to set … Read more