class yeye: def __init__(self): self.a=1 self.b=2 def chi(self): print(self.a) def he(self): print(self.b) class dad(yeye): def wan(self): self.b=3 print(self.b) B=yeye() B.chi() B.he() A=dad() print(A.a,A.b) A.wan()
python继承
最新推荐文章于 2022-02-22 23:04:49 发布