Solution Review 1: Override a Method using the Super Function
This review provides a detailed explanation of the 'Override a Method using the Super Function' challenge.
We'll cover the following...
Solution
Python 3.5
# Parent Classclass Shape:sname = "Shape"def getName(self):return self.sname# child classclass XShape(Shape):# initializerdef __init__(self, name):self.xsname = namedef getName(self): # overriden methodreturn (super().getName() + ", " + self.xsname)circle = XShape("Circle")print(circle.getName())
...
Ask