Boolean logic 2 for python core. Create a program that outputs whether a store is open or closed. I got all test cases except 1 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Boolean logic 2 for python core. Create a program that outputs whether a store is open or closed. I got all test cases except 1

I did. hour = int(input()) day = int(input ()) if hour>=10 and hour<=21: if day >=1 and day <=5: print("Open") else: Print("Closed") I got all test cases correct except for one hidden test case (test case 4 to be exact). What did I do wrong??

2nd Jan 2022, 5:08 PM
Jamison McKinney
Jamison McKinney - avatar
3 Answers
+ 5
It gives no output when day is Saturday(or Sunday), 10 <= hour <=21. Try adding another else statement for second if
2nd Jan 2022, 5:21 PM
Simba
Simba - avatar
+ 4
I mean hour = int(input()) day = int(input ()) if hour>=10 and hour<=21: if day >=1 and day <=5: print("Open") else: print("Closed") else: print("Closed") You're welcome!
2nd Jan 2022, 5:41 PM
Simba
Simba - avatar
+ 1
Simba I ended up using range instead. I haven't learned that one yet but someone PM me a post from a year ago where you suggested that to someone else and that ended up working. I got a long road ahead of me so thankyou for your help!
2nd Jan 2022, 5:34 PM
Jamison McKinney
Jamison McKinney - avatar