from car import Car
# from model_name import class_name
my_new_car = Car('audi','a4',2024)print(my_new_car.get_descriptive_name())
my_new_car.odometer_reading =23
my_new_car.read_odometer()
从一个模块中导入多个类
from car import Car, ElectricCar
# from model_name import class_name,class_name
my_mustang = Car('ford','mustang',2024)print(my_mustang.get_descriptive_name())
my_leaf = ElectricCar('nissan','leaf',2024)print(my_leaf.get_descriptive_name())
# electric_car.pyfrom car import Car
# my_car.pyfrom car import Car
from electric_car import ElectricCar
my_mustang = Car('ford','mustang',2024)print(my_mustang.get_descriptive_name())
my_leaf = ElectricCar('nissan','leaf',2024)print(my_leaf.get_descriptive_name())