1 class a(): 2 def __init__(self,aa): 3 self.aa = aa 4 class b(a): 5 def do(self): 6 print (self.aa) 7 #bb = b()#报错 8 bb =b(2) 9 bb.do()