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
PostgreSQLv16

Hier erscheint das Ergebnis der Codeausführung

Visible tests
1
Input
60, False
Expected0
2
Input
65, False
Expected1
3
Input
65, True
Expected0
4
Input
85, False
Expected2
5
Input
85, True
Expected1
6
Input
81, False
Expected2
Focus radio
Paused · SomaFM · Fluid