class Vehicle:
def __init__(self, name):
self.__name = name
self.speed = 1.0
@property
def name(self):
return self.__name
def move(self, distance):
print("Moving")
return distance / self.speed
def describe(self):
return ""
class Vehicle:
def __init__(self, name):
self.__name = name
self.speed = 1.0
@property
def name(self):
return self.__name
def move(self, distance):
print("Moving")
return distance / self.speed
def describe(self):
return ""
class Vehicle:
def __init__(self, name):
self.__name = name
self.speed = 1.0
@property
def name(self):
return self.__name
def move(self, distance):
print("Moving")
return distance / self.speed
def describe(self):
return ""
from Vehicle import *
class Airplane(Vehicle):
def __init__(self, name, wingspan, capacity):
self.__name = name
self.__wingspan = wingspan
self.__capacity = capacity
from Vehicle import *
class Airplane(Vehicle):
def __init__(self, name, wingspan, capacity):
self.__name = name
self.__wingspan = wingspan
self.__capacity = capacity
from Airplane import *
class Main:
@staticmethod
def main():
a = Airplane("Test", 123, 45)
print(a.name)
# main guard
if __name__ == "__main__":
Main.main()
from Vehicle import *
class Airplane(Vehicle):
def __init__(self, name, wingspan, capacity):
self.__name = name
self.__wingspan = wingspan
self.__capacity = capacity
from Airplane import *
class Main:
@staticmethod
def main():
a = Airplane("Test", 123, 45)
print(a.name)
# main guard
if __name__ == "__main__":
Main.main()
class Vehicle:
def __init__(self, name):
self.__name = name
self.speed = 1.0
@property
def name(self):
return self.__name
def move(self, distance):
print("Moving")
return distance / self.speed
def describe(self):
return ""
class Vehicle:
def __init__(self, name):
self.__name = name
self.speed = 1.0
@property
def name(self):
return self.__name
def move(self, distance):
print("Moving")
return distance / self.speed
def describe(self):
return ""
from Vehicle import *
class Airplane(Vehicle):
def __init__(self, name, wingspan, capacity):
self.__name = name
self.__wingspan = wingspan
self.__capacity = capacity
from Vehicle import *
class Airplane(Vehicle):
def __init__(self, name, wingspan, capacity):
super().__init__(name)
self.__wingspan = wingspan
self.__capacity = capacity
from Vehicle import *
class Airplane(Vehicle):
def __init__(self, name, wingspan, capacity):
super().__init__(name)
self.__wingspan = wingspan
self.__capacity = capacity
from Vehicle import *
class Airplane(Vehicle):
def __init__(self, name, wingspan, capacity):
super().__init__(name)
self.__wingspan = wingspan
self.__capacity = capacity
def __landing_gear(self, set):
if set:
print("Landing gear down")
else:
print("Landing gear up")
from Vehicle import *
class Airplane(Vehicle):
def __init__(self, name, wingspan, capacity):
super().__init__(name)
self.__wingspan = wingspan
self.__capacity = capacity
def __landing_gear(self, set):
if set:
print("Landing gear down")
else:
print("Landing gear up")
def move(self, distance):
self.__landing_gear(False)
print("Moving")
self.__landing_gear(True)
return distance / self.speed
from Vehicle import *
class Airplane(Vehicle):
def __init__(self, name, wingspan, capacity):
super().__init__(name)
self.__wingspan = wingspan
self.__capacity = capacity
def __landing_gear(self, set):
if set:
print("Landing gear down")
else:
print("Landing gear up")
def move(self, distance):
self.__landing_gear(False)
print("Moving")
self.__landing_gear(True)
return distance / self.speed
from Vehicle import *
class Airplane(Vehicle):
def __init__(self, name, wingspan, capacity):
super().__init__(name)
self.__wingspan = wingspan
self.__capacity = capacity
def __landing_gear(self, set):
if set:
print("Landing gear down")
else:
print("Landing gear up")
def move(self, distance):
self.__landing_gear(False)
print("Moving")
self.__landing_gear(True)
return distance / self.speed
def describe(self):
return "I am an airplane with a wingspan of {}
and capacity {}".format(self.__wingspan,
self.__capacity)
from Vehicle import *
class Airplane(Vehicle):
def __init__(self, name, wingspan, capacity):
super().__init__(name)
self.__wingspan = wingspan
self.__capacity = capacity
def __landing_gear(self, set):
if set:
print("Landing gear down")
else:
print("Landing gear up")
def move(self, distance):
self.__landing_gear(False)
print("Moving")
self.__landing_gear(True)
return distance / self.speed
def describe(self):
return "I am an airplane with a wingspan of {}
and capacity {}".format(self.__wingspan,
self.__capacity)
from Vehicle import *
from Airplane import *
class Main:
@staticmethod
def main():
vehicle = Vehicle("Boat")
airplane = Airplane("Plane", 175, 53)
print(vehicle.move(10))
print(airplane.move(10))
print(vehicle.describe())
print(airplane.describe())
# main guard
if __name__ == "__main__":
Main.main()
from Vehicle import *
from Airplane import *
class Main:
@staticmethod
def main():
vehicle = Vehicle("Boat")
airplane = Airplane("Plane", 175, 53)
print(vehicle.move(10))
print(airplane.move(10))
print(vehicle.describe())
print(airplane.describe())
# main guard
if __name__ == "__main__":
Main.main()
Moving
10.0
Landing gear up
Moving
Landing gear down
10.0
I am an airplane with a wingspan of 175 and capacity 53
from Vehicle import *
from Airplane import *
class Main:
@staticmethod
def main():
vehicle = Vehicle("Boat")
airplane = Airplane("Plane", 175, 53)
print(vehicle.move(10))
print(airplane.move(10))
print(vehicle.describe())
print(airplane.describe())
# main guard
if __name__ == "__main__":
Main.main()
Moving
10.0
Landing gear up
Moving
Landing gear down
10.0
I am an airplane with a wingspan of 175 and capacity 53
from Vehicle import *
from Airplane import *
class Main:
@staticmethod
def main():
vehicle = Vehicle("Boat")
airplane = Airplane("Plane", 175, 53)
print(vehicle.move(10))
print(airplane.move(10))
print(vehicle.describe())
print(airplane.describe())
# main guard
if __name__ == "__main__":
Main.main()
Moving
10.0
Landing gear up
Moving
Landing gear down
10.0
I am an airplane with a wingspan of 175 and capacity 53
from Vehicle import *
from Airplane import *
class Main:
@staticmethod
def main():
vehicle = Vehicle("Boat")
airplane = Airplane("Plane", 175, 53)
print(vehicle.move(10))
print(airplane.move(10))
print(vehicle.describe())
print(airplane.describe())
# main guard
if __name__ == "__main__":
Main.main()
Moving
10.0
Landing gear up
Moving
Landing gear down
10.0
I am an airplane with a wingspan of 175 and capacity 53
from Vehicle import *
from Airplane import *
class Main:
@staticmethod
def main():
vehicle = Vehicle("Boat")
airplane = Airplane("Plane", 175, 53)
print(vehicle.move(10))
print(airplane.move(10))
print(vehicle.describe())
print(airplane.describe())
# main guard
if __name__ == "__main__":
Main.main()
Moving
10.0
Landing gear up
Moving
Landing gear down
10.0
I am an airplane with a wingspan of 175 and capacity 53
from Vehicle import *
from Airplane import *
class Main:
@staticmethod
def main():
vehicle = Vehicle("Boat")
airplane = Airplane("Plane", 175, 53)
print(vehicle.move(10))
print(airplane.move(10))
print(vehicle.describe())
print(airplane.describe())
# main guard
if __name__ == "__main__":
Main.main()
Moving
10.0
Landing gear up
Moving
Landing gear down
10.0
I am an airplane with a wingspan of 175 and capacity 53
from Vehicle import *
from Airplane import *
class Main:
@staticmethod
def main():
vehicle = Vehicle("Boat")
airplane = Airplane("Plane", 175, 53)
print(vehicle.move(10))
print(airplane.move(10))
print(vehicle.describe())
print(airplane.describe())
# main guard
if __name__ == "__main__":
Main.main()
Moving
10.0
Landing gear up
Moving
Landing gear down
10.0
I am an airplane with a wingspan of 175 and capacity 53
from Vehicle import *
from Airplane import *
class Main:
@staticmethod
def main():
vehicle = Vehicle("Boat")
airplane = Airplane("Plane", 175, 53)
print(vehicle.move(10))
print(airplane.move(10))
print(vehicle.describe())
print(airplane.describe())
# main guard
if __name__ == "__main__":
Main.main()
Moving
10.0
Landing gear up
Moving
Landing gear down
10.0
I am an airplane with a wingspan of 175 and capacity 53
from Vehicle import *
class MotorVehicle(Vehicle):
def __init__(self, name):
super().__init__(name)
self.number_of_wheels = 2
self.engine_volume = 125
def honk_horn():
return ""