Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def main():
- # Prototypy samochodów
- tesla_prototype = ElectricCar("Tesla Model S", 100)
- bmw_prototype = GasolineCar("BMW 3 Series", 2.0)
- # Fabryki samochodów
- electric_car_factory = ElectricCarFactory(tesla_prototype)
- gasoline_car_factory = GasolineCarFactory(bmw_prototype)
- # Tworzenie samochodów za pomocą fabryk
- electric_car1 = electric_car_factory.create_car()
- electric_car2 = electric_car_factory.create_car()
- gasoline_car1 = gasoline_car_factory.create_car()
- gasoline_car2 = gasoline_car_factory.create_car()
- # Wyświetlanie specyfikacji samochodów
- print(electric_car1.specifications())
- print(electric_car2.specifications())
- print(gasoline_car1.specifications())
- print(gasoline_car2.specifications())
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement