Party Range

Imagine a strange party counter where success depends on both the number of cigars and whether it is the weekend. Write a function cigar_party that takes the number cigars and the boolean flag is_weekend. On a regular day, the party succeeds with 40 to 60 cigars inclusive; on the weekend, it succeeds with 40 or more and no upper limit.

Примеры

Ввод
30, False
Вывод
False
Ввод
50, False
Вывод
True
Ввод
70, True
Вывод
True

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

def cigar_party(cigars: int, is_weekend: bool) -> bool:

Теги

math
PostgreSQLv16

Itt jelenik meg a kód futtatásának eredménye

Visible tests
1
Input
30, False
ExpectedFalse
2
Input
50, False
ExpectedTrue
3
Input
70, True
ExpectedTrue
4
Input
70, False
ExpectedFalse
5
Input
40, False
ExpectedTrue
6
Input
60, False
ExpectedTrue
Focus radio
Paused · SomaFM · Fluid