EX:
class Parent:
def name(self):
print("This is the parent method name()")
class Child(Parent):
def name(self):
super(Child, self).name()
super().name()
dad = Parent()
son = Child()
dad.name()
son.name()
Output:
This is the parent method name()
This is the parent method name()
This is the parent method name()
I am confused as to why this works correctly in both cases, and I would like to know when I would have to use the super(Child, self).name() form in my code. Any help is greatly appreciated!