Skip to content

Commit e346383

Browse files
committed
change order of condition. remove init function from custom exception.
1 parent a2e7224 commit e346383

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Metro/Metro_RP2350_Snake/snake_helpers.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def __init__(self, speed):
279279
:param speed: speed as a value 0-20, lower is faster.
280280
"""
281281
# limit speed to the range 0-20
282-
if 0 > speed or speed > 20:
282+
if speed < 0 or speed > 20:
283283
raise ValueError("Speed must be between 0 and 20")
284284

285285
# store speed value on self
@@ -348,6 +348,3 @@ class GameOverException(Exception):
348348
Exception that indicates the game is over.
349349
Message will contain the reason.
350350
"""
351-
352-
def __init__(self, message):
353-
super().__init__(message)

0 commit comments

Comments
 (0)