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
Entre para ver seu histórico de envios
EntrarEntre para usar o AI Mentor
EntrarVisible tests
1
Input
True, 6Expected
True2
Input
True, 7Expected
False3
Input
False, 6Expected
False4
Input
True, 21Expected
True5
Input
True, 20Expected
False6
Input
False, 23Expected
FalseFocus radio
Paused · SomaFM · Fluid