コード例 #1
0
    def __init__(self, money, faceValue):
        '''
		多继承时,调用父类构造方法的格式:父类名.__init__(self,[,参数列表])
		单继承时,调用父类构造方法的格式:super.__init__(self,[,参数列表])
		'''
        Father.__init__(self, money)
        Mother.__init__(self, faceValue)
コード例 #2
0
 def __init__(self, money, faceValue):
     Father.__init__(self, money)
     Mother.__init__(self, faceValue)
コード例 #3
0
ファイル: child.py プロジェクト: stone0630/python
 def __init__(self, money, face):
     Father.__init__(self, money=money)
     Mather.__init__(self, face=face)
コード例 #4
0
    def __init__(self, money, facevalue):
        Father.__init__(self, money)
        Mother.__init__(self, facevalue)

        print(Father.eat(self))
        print(Mother.eat(self))
コード例 #5
0
ファイル: child.py プロジェクト: Xiaochaosui/python_learning
 def __init__(self, money, faceValue):
     Father.__init__(self, money)
     Mother.__init__(self, faceValue)
     self.height = 170