Esempio n. 1
0
from electric_car import Car, ElectricCar

my_beetle = Car('volkswagen','beetle',2019)
my_beetle.get_descriptive_name()

my_tesla = ElectricCar('tesla','roadster',2019)
my_tesla.get_descriptive_name()

# my_battery = Battery()
Esempio n. 2
0
from electric_car import Car, ElectricCar
import electric_car
from car import *  # This import all class of module car

my_new_e_car = ElectricCar("Toyota", "Prius", "2018")
print(my_new_e_car.get_name())

my_new_car = Car("Maruti", "Swift", "2018")
print(my_new_car.get_name())

my_toyoto = electric_car.ElectricCar("Toyota", "Prius", "2018")
print(my_toyoto.get_name())

my_maruti = electric_car.Car("Maruti", "Swift", "2018")
print(my_maruti.get_name())
Esempio n. 3
0
# coding = uft-8
from electric_car import Car, ElectricCar

my_audi = Car('audi', 'A6L', 2016)
print(my_audi.car_describe())

my_tesla = ElectricCar('tesla', 'roadster', 2017)
print(my_tesla.car_describe())

my_tesla.battery.describe_battery()
my_tesla.battery.get_range()
Esempio n. 4
0
# author:ToddCombs
# 在一个文件/模块中导入多个类
from electric_car import Car, ElectricCar
my_beetle = Car('volkswagen', 'beetle', 2016)
print(my_beetle.get_descriptive_name())

my_tesla = ElectricCar('tesla', 'model s', 2022)
print(my_tesla.get_descriptive_name())
Esempio n. 5
0
from electric_car import Car, ElectricCar

my_new_car = Car('audi', 'a4', 2016)
print(my_new_car.get_desctiptive_name())

my_new_car.odometer_reading = 23
my_new_car.read_odometer()

my_beetle = Car('volkswagen', 'beetle', 2016)
print(my_beetle.get_desctiptive_name())

my_tesla = ElectricCar('tesla', 'roadster', 2016)
print(my_tesla.get_desctiptive_name())
Esempio n. 6
0
from electric_car import Car, ElectricCar

my_beetle = Car("volkswagen", "beetle", 2016)
print(my_beetle.get_descriptive_name())

my_tesla = ElectricCar("tesla", "roadster", 2016)
print(my_tesla.get_descriptive_name())

# import electric_car
#
# my_beetle = electric_car.Car("volkswagen", "beetle", 2016)
# print(my_beetle.get_descriptive_name())
#
# my_tesla = electric_car.ElectricCar("tesla", "roadster", 2016)
# print(my_tesla.get_descriptive_name())