Python10.24

# class Car:
#     def __init__(self, color):
#         self.color = color
#
#     auto = True
#     brand = ""
#     size = ""
#     mod = "刹车"
#
#     def __del__(self):
#         print("del")
#
#     def set_color(self):
#         print(f"车的颜色为:{self.color}")
#
#
# car_one = Car("红色")
# car_one.set_color()
# car_one.brand = "a123"
# car_one.size = "s456"
# car_one.auto = False
# car_one.mod = "启动汽车"

class Car:
    def __init__(self, brand, model, auto_drive=False):
        self.__color = None
        self.brand = brand
        self.model = model
        self.auto_drive = auto_drive

    def __del__(self):
        print("del")

    def set_color(self, color):
        self.__color = color

    def get_color(self):
        return self.__color

    def start(self):
        print("启动汽车")

    def brake(self):
        print("刹车")

    def auto_drive(self):
        if self.auto_drive:
            print("汽车支持自动驾驶")
        else:
            print("不支持自动驾驶")


car_1 = Car
car_1.set_color(self=car_1, color="红色")
car_1.get_color()

(没搞懂)