コード例 #1
0
ファイル: main.py プロジェクト: blavis21/Garys-Garage
from mustang import Mustang
from ram import Ram
from leaf import Leaf
from crosstrek import Crosstrek

mach1 = Mustang()
mach1.refuel()
mach1.drive()
mach1.drive()

cummins = Ram()
cummins.refuel()
cummins.drive()
cummins.drive()

hippie = Leaf()
hippie.refuel()
hippie.drive()
hippie.drive()

busaru = Crosstrek()
busaru.refuel()
busaru.drive()
busaru.drive()
コード例 #2
0
ファイル: main.py プロジェクト: Jeff-Hill/Python-Intro
from leaf import Leaf
from crosstrek import CrossTrek
from pumpstation import PumpStation
from chargingstation import ChargingStation

ram = Ram()
must = Mustang()
tree = Leaf()

gas_pump_station = PumpStation()
electric_charging_station = ChargingStation()

gas_pump_station.add_vehicle(ram)
gas_pump_station.add_vehicle(must)
electric_charging_station.add_vehicle(tree)

the_hotness = Mustang()
the_hotness.refuel()
the_hotness.drive()

buzz = Leaf()
buzz.refuel()
buzz.drive()

buzz_growl = CrossTrek()
buzz_growl.refuel()
buzz_growl.drive()