Change LARGE to VehicleSize.LARGE in parking lot solution (#146)

This commit is contained in:
cclauss 2018-04-09 02:25:11 +02:00 committed by Donne Martin
parent ea262de564
commit 1b339dbdde

View File

@ -45,7 +45,7 @@ class Car(Vehicle):
super(Car, self).__init__(VehicleSize.COMPACT, license_plate, spot_size=1)
def can_fit_in_spot(self, spot):
return True if (spot.size == LARGE or spot.size == COMPACT) else False
return spot.size in (VehicleSize.LARGE, VehicleSize.COMPACT)
class Bus(Vehicle):
@ -54,7 +54,7 @@ class Bus(Vehicle):
super(Bus, self).__init__(VehicleSize.LARGE, license_plate, spot_size=5)
def can_fit_in_spot(self, spot):
return True if spot.size == LARGE else False
return spot.size == VehicleSize.LARGE
class ParkingLot(object):