抽象多态继承方法
继承
class Shape():
def __init__(self,w,l):
self.width = w
self.length = l
def print_size(self):
print("""{} by {}
""".format(self.width,
self.length))
class Square(Shape):#继承了Shape
pass
square = Square(20,20)
square.print_size()
方法覆盖
class Shape():
def __init__(self,w,l):
self.width = w
self.length = l
def print_size(self):
print("""{} by {}
""".format