本文整理汇总了Python中car.Car.get_descriptive_name方法的典型用法代码示例。如果您正苦于以下问题:Python Car.get_descriptive_name方法的具体用法?Python Car.get_descriptive_name怎么用?Python Car.get_descriptive_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类car.Car
的用法示例。
在下文中一共展示了Car.get_descriptive_name方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Car
# 需要导入模块: from car import Car [as 别名]
# 或者: from car.Car import get_descriptive_name [as 别名]
from car import Car
from electric_car import ElectricCar
my_beetle = Car('volkswagen', 'beetle', 2015)
print(my_beetle.get_descriptive_name())
my_tesla = ElectricCar('tesla', 'roadster', 2015)
print(my_tesla.get_descriptive_name())
示例2: Car
# 需要导入模块: from car import Car [as 别名]
# 或者: from car.Car import get_descriptive_name [as 别名]
from car import Car
my_new_car = Car('audi', 'a4', 2016)
print(my_new_car.get_descriptive_name())
my_new_car.odometer_reading = 23
my_new_car.read_odometer()
示例3: Car
# 需要导入模块: from car import Car [as 别名]
# 或者: from car.Car import get_descriptive_name [as 别名]
from car import Car
from electric_car import ElectricCar
my_beetle = Car('volswagen', 'beetle', 2015, 9800)
my_tesla = ElectricCar('tesla', 'roadster', '2016', 970)
my_beetle.get_descriptive_name()
my_tesla.get_descriptive_name()
my_tesla.battery.about_battery()
示例4: Car
# 需要导入模块: from car import Car [as 别名]
# 或者: from car.Car import get_descriptive_name [as 别名]
from car import Car
new_car = Car('jeep', 'wrangler', '2004', 67000)
new_car.get_descriptive_name()
new_car.update_odometer(67888)
new_car.battery.about_battery()
new_car.fill_gastank(90)
示例5: print
# 需要导入模块: from car import Car [as 别名]
# 或者: from car.Car import get_descriptive_name [as 别名]
#! /usr/bin/python
# import car
# from car import Car
# from car import ElectricCar
from car import Car, ElectricCar
print()
# Importing a Single Class
my_new_car = Car('audi', 'a4', 2016)
print(my_new_car.get_descriptive_name())
my_new_car.odometer_reading = 23
my_new_car.read_odometer()
print()
# Storing Multiple Classes in a Module
my_tesla = ElectricCar('tesla', 'model s', 2016)
print(my_tesla.get_descriptive_name())
my_tesla.battery.describe_battery()
my_tesla.battery.get_range()
print()
# Importing Multiple Classes from a Module
my_beetle = Car('volkswagen', 'beetle', 2016)
print(my_beetle.get_descriptive_name())
my_tesla = ElectricCar('tesla', 'roadster', 2016)
print(my_tesla.get_descriptive_name())