关于Python中继承的格式总结

自己总结一下继承的格式

class Father:

       def__init__(self,Y1,Y2):

              self.X1=Y1

              selfX2=Y2

       def tell(self):

              print’this is “%s”and”%s”:’%(self.X1,self.X2)

class son(Father):

       def__init__(self,Y1,Y2,Y3):

              Father.__init__(self,Y1,Y2)

              Self.X3=Y3

       def tell:

              Father.tell(self)

              print’this is “%s”’%self.X3

posted @ 2017-09-06 11:17  云中摆渡的老船长  阅读(319)  评论(0编辑  收藏  举报

It's not who you are underneath, it's what you do that defines you

Brick walls are there for a reason :they let us prove how badly we want things