Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wwwanlingxiao
system-design-primer
Commits
1b339dbd
Commit
1b339dbd
authored
Apr 09, 2018
by
cclauss
Committed by
Donne Martin
Apr 08, 2018
Browse files
Change LARGE to VehicleSize.LARGE in parking lot solution (#146)
parent
ea262de5
Changes
1
Hide whitespace changes
Inline
Side-by-side
solutions/object_oriented_design/parking_lot/parking_lot.py
View file @
1b339dbd
...
...
@@ -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
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment