+ 2

Can you solve this?

You need to create a program that outputs whether a store is Open or Closed, based on the hour and the day of the week. The store is open on all days from 10 to 21, except Saturday and Sunday. You need to take the hour and the day of the week as input. The day of the week is represented as an integer (1 for Monday, 2 for Tuesday, etc.) Sample Input: 15 4 Sample Output: Open

26th May 2021, 12:32 PM
Hamid Sarkarwale
13 Antworten
+ 7
You are only using the variable 'day'. What about 'hour'?
26th May 2021, 1:11 PM
David Ashton
David Ashton - avatar
+ 6
Read the task carefully. "The store is open on all days from 10 to 21, except Sunday and Saturday" It means it's opened for 11hours (10-21) in a day and 5 days in a week. Hope you know there are 7 days in a week. day ==13 or day == 20 isn't valid condition You need to create a code to check these two conditions :)
26th May 2021, 2:58 PM
Simba
Simba - avatar
+ 2
hour = int(input()) day = int(input()) # your code goes here if (day==6 or day==7): print("Closed") elif ((day!=6 or day!=7) and (hour>=10 and hour<=21)): print("Open") else: print("Closed") I got the answer of my question thanks to all.
28th May 2021, 2:19 AM
Hamid Sarkarwale
+ 1
There are 6 cases 5 cases runing but 1 case is wrong and that case is locked is anyone faced this question? Please help me
26th May 2021, 12:33 PM
Hamid Sarkarwale
0
hour = int(input()) day = int(input()) # your code goes here if (day==13 or day==14): print("Closed") elif (day==20 or day==21): print("Closed") elif (day==6 or day==7): print("Closed") else: print("Open")
26th May 2021, 12:44 PM
Hamid Sarkarwale
0
Store is open for 24 hours so i didn't put hours
26th May 2021, 2:50 PM
Hamid Sarkarwale
0
Yes but 1 case is not running out of 6 thats the problem and I don't know what's that case because it is locked case.
26th May 2021, 2:55 PM
Hamid Sarkarwale
0
Yes i got it thank u for comment and help sir
26th May 2021, 3:00 PM
Hamid Sarkarwale
0
If monday to friday AND 10 o clock to 21 o clock , then store open Saterday and sunday closed, store closed
26th May 2021, 3:08 PM
Angela
Angela - avatar
0
I guess 10 to 21 are hrs in a 24hr clock ,not the days! As they already mention week has only 7 days and that s from 0 to 7 https://code.sololearn.com/cA2TKbAvr8px/?ref=app It has to look something like this
27th May 2021, 1:20 PM
RuntimeERROR
RuntimeERROR - avatar
0
Define required variable with associated time of the day
27th May 2021, 4:18 PM
ADEDEJI EMMANUEL
ADEDEJI EMMANUEL - avatar