#!/usr/bin/python3.8

#ඨ
class people:
    #
    name = ''
    age = 0
    #˽ԣ˽ⲿ޷ֱӽз
    __weight = 0

    #幹췽
    def __init__(self,n,a,w):
        self.name = n
        self.age = a
        self.__weight = w
    def speak(self):
        print("%s ˵%dꡣ" %(self.name,self.age))

#̳ʾ
class student(people):
    grade = ''
    def __init__(self,n,a,w,g):

        #øĹ
        people.__init__(self,n,a,w)
        self.grade = g

    #дķ
    def speak(self):
        print("%s ˵%dˣڶ%d꼶"%(self.name,self.age,self.grade))

#һ̳֮࣬ǰ׼
class speaker():
    topic = ''
    name = ''
    def __init__(self,n,t):
        self.name = n
        self.topic = t
    def speak(self):
        print("ҽ%sһ˵ңݽ %s"%(self.name,self.topic))

#̳
class sample(speaker,student):
    a =''
    def __init__(self,n,a,w,g,t):
        student.__init__(self,n,a,w,g)
        speaker.__init__(self,n,t)

test = sample("Tim",25,80,4,"Python")

test.speak()   #ͬĬϵõǰĸķ
ϳнΪ
ҽTimһ˵ңݽ Python