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
Conectează-te pentru a vedea istoricul soluțiilor trimise
Conectează-teConectează-te pentru a folosi Mentorul AI
Conectează-teVisible tests
1
Input
30, FalseExpected
False2
Input
50, FalseExpected
True3
Input
70, TrueExpected
True4
Input
70, FalseExpected
False5
Input
40, FalseExpected
True6
Input
60, FalseExpected
TrueFocus radio
Paused · SomaFM · Fluid