-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
您的答案 (Your Solution)
class Car:
"""一个代表汽车的基类。"""
def __init__(self, brand: str, model: str) -> None:
self.brand = brand
self.model = model
def get_full_name(self) -> str:
return self.brand + " " + self.model
class ElectricCar(Car):
def __init__(self, brand: str, model: str, battery_size: str) -> None:
super().__init__(brand, model)
self.battery_size = battery_size
def get_battery_info(self) -> str:
return f"Battery size: {self.battery_size}"解题思路 (Thought Process)
No response
其他信息 (Additional context)
No response