From 5d01ff2b340df79145d696375a9201ed30f97245 Mon Sep 17 00:00:00 2001 From: shivral <79295827+shivral@users.noreply.github.com> Date: Thu, 15 Jun 2023 10:17:20 +0530 Subject: [PATCH] Update parking_lot.py Fixed the typo where spot size was not being assigned and cleaned up the supers --- .../object_oriented_design/parking_lot/parking_lot.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/solutions/object_oriented_design/parking_lot/parking_lot.py b/solutions/object_oriented_design/parking_lot/parking_lot.py index 08852d9d..d6119e94 100644 --- a/solutions/object_oriented_design/parking_lot/parking_lot.py +++ b/solutions/object_oriented_design/parking_lot/parking_lot.py @@ -14,7 +14,7 @@ class Vehicle(metaclass=ABCMeta): def __init__(self, vehicle_size, license_plate, spot_size): self.vehicle_size = vehicle_size self.license_plate = license_plate - self.spot_size + self.spot_size=spot_size self.spots_taken = [] def clear_spots(self): @@ -33,7 +33,7 @@ class Vehicle(metaclass=ABCMeta): class Motorcycle(Vehicle): def __init__(self, license_plate): - super(Motorcycle, self).__init__(VehicleSize.MOTORCYCLE, license_plate, spot_size=1) + super().__init__(VehicleSize.MOTORCYCLE, license_plate, spot_size=1) def can_fit_in_spot(self, spot): return True @@ -42,7 +42,7 @@ class Motorcycle(Vehicle): class Car(Vehicle): def __init__(self, license_plate): - super(Car, self).__init__(VehicleSize.COMPACT, license_plate, spot_size=1) + super().__init__(VehicleSize.COMPACT, license_plate, spot_size=1) def can_fit_in_spot(self, spot): return spot.size in (VehicleSize.LARGE, VehicleSize.COMPACT) @@ -51,7 +51,7 @@ class Car(Vehicle): class Bus(Vehicle): def __init__(self, license_plate): - super(Bus, self).__init__(VehicleSize.LARGE, license_plate, spot_size=5) + super().__init__(VehicleSize.LARGE, license_plate, spot_size=5) def can_fit_in_spot(self, spot): return spot.size == VehicleSize.LARGE