# 子类不会拥有父类的私有成员 也不能访问父类的私有成员class Cat(object):def __init__(self, color):self.color = colorself.__age = 1def walk(self):print("走猫步~")def __test(self):print('父类私有变量')class SF(Cat):passflod = SF("黑色")print(f"{flod.color}的猫")flod.walk()# print(flod.__age)# flod.__test();
