Python进阶学习笔记-面向对象篇

组合 class Engine: """引擎类,提供基本的引擎功能""" def __init__(self, power): self.power = power def start(self): print(f"引擎启动,功率:{self.power}") class Car: """汽车类,使
posted @ 2024-06-23 14:39  wanghongwei-dev  阅读(4)  评论(0编辑  收藏  举报