+ 7
Hi, Why everything is "Open"?
I tried all options but it can't. https://code.sololearn.com/caG787r9YzEM/?ref=app
9 Answers
+ 8
Thanks for all -)
+ 6
I removed it but when I input 11, 6 the output is Open instead of "Closed".
+ 6
So, what I've to do?
+ 4
Egor Tonchev(EGO)
Problem is with day. It should be integer
+ 2
In order for the store to be Open, the hour must be in the range 10-21 and the day must be less than 6. Otherwise, the store is Closed.
You can express the hour being in the range a few ways;
10 <= hour <= 21
hour >= 10 and hour <= 21
hour in range(10, 22)
All you should need is an if-else statement here. Check the hour in one of the ways above then also check to see that it is not the weekend by 'and day < 6'
Something like;
if (10 <= hour <= 21) and day < 6:
...
else:
...
+ 2
Egor Tonchev(EGO)
Nothing your code is right. I have got all test cases passed.
+ 2
Egor Tonchev(EGO)
Yes, now that you've made those changes, all you need to do is make sure that the input() for day is converted to an int() like the hour is.
+ 1
hour cant be less than or equal to 10 AND greater than or equal to 21
+ 1
Thats because of the elif statement. It says that if the hour is greater than/equal 10 and less than/equal to 21, then print "Open". Wich it does