Speeding Ticket
Imagine a simple speed camera that turns your speed into a ticket level. Write a function caught_speeding that takes the speed speed and the boolean flag is_birthday. Normally, 60 or less means no ticket, 61 to 80 means a small ticket, and 81 or more means a big ticket; on your birthday, both limits are 5 higher.
Примеры
Ввод
60, FalseВывод
0Ввод
65, FalseВывод
1Ввод
65, TrueВывод
0Нужно реализовать
def caught_speeding(speed: int, is_birthday: bool) -> int:
Теги
math
Συνδεθείτε για να δείτε το ιστορικό υποβολών
ΣύνδεσηΣυνδεθείτε για να χρησιμοποιήσετε τον AI Mentor
ΣύνδεσηVisible tests
1
Input
60, FalseExpected
02
Input
65, FalseExpected
13
Input
65, TrueExpected
04
Input
85, FalseExpected
25
Input
85, TrueExpected
16
Input
81, FalseExpected
2Focus radio
Paused · SomaFM · Fluid