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??
3 Respuestas
+ 5
It gives no output when day is Saturday(or Sunday), 10 <= hour <=21.
Try adding another else statement for second if
+ 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!
+ 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!