Skip to content

Commit c81023c

Browse files
Update caught_speeding.py
1 parent 20ca17f commit c81023c

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

logic-1/caught_speeding.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
def caught_speeding(speed, is_birthday):
22
speed0 = 60
3-
speed1 = 61
4-
speed2 = 81
3+
speed1 = 80
54

6-
if(is_birthday == "yes"):
5+
if (is_birthday == True):
76
speed0 = speed0 + 5
87
speed1 = speed1 + 5
9-
speed2 = speed2 + 5
10-
11-
if(speed <= speed0):
8+
9+
if (speed <= speed0):
1210
return 0
13-
elif(speed1 <= speed < speed2):
11+
elif (speed <= speed1):
1412
return 1
15-
elif(speed2 <= speed):
13+
else:
1614
return 2
1715

1816
speed = input("What is your speed? ")
1917
is_birthday = raw_input("Is it your birthday? (yes or no) ")
2018

21-
print(caught_speeding(speed,is_birthday))
19+
print(caught_speeding(speed,is_birthday))

0 commit comments

Comments
 (0)