Noisy Parrot

Boolean conditions often describe simple real-life rules: there is a problem only when several signs match at once. Write a function parrot_trouble that takes the boolean flag talking and the hour hour in the range 0 to 23. Return True if the parrot is talking before 7 in the morning or after 20 in the evening; otherwise, return False.

Примеры

Ввод
True, 6
Вывод
True
Ввод
True, 7
Вывод
False
Ввод
False, 6
Вывод
False

Нужно реализовать

def parrot_trouble(talking: bool, hour: int) -> bool:

Теги

math
PostgreSQLv16

Her vises resultatet af din kode

Visible tests
1
Input
True, 6
ExpectedTrue
2
Input
True, 7
ExpectedFalse
3
Input
False, 6
ExpectedFalse
4
Input
True, 21
ExpectedTrue
5
Input
True, 20
ExpectedFalse
6
Input
False, 23
ExpectedFalse
Focus radio
Paused · SomaFM · Fluid