Noisy Parrot

Programs often need to check two conditions at once: an event happened, and the timing is bad. Write a function parrot_trouble that takes the boolean flag talking and the hour hour from 0 to 23. Return True if the parrot is talking before 7 in the morning or after 20 in the evening. If the parrot is quiet or the time is acceptable, return False.

Примеры

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

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

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

Теги

math
PostgreSQLv16

Ovdje će se prikazati rezultat izvršavanja koda

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
True, 999999
ExpectedTrue
Focus radio
Paused · SomaFM · Fluid