Exemplo 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()
Exemplo 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())
Exemplo 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()
Exemplo 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())
Exemplo 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())
Exemplo 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())