- 1

Boolean logic

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.) My code hour = int(input()) day = int(input()) # your code goes here if(hour<10 and hour>21): if(day==6 and day==7): print('Closed') else: print('Open')

3rd Dec 2020, 5:26 PM
Abhishek Sinha
Abhishek Sinha - avatar
2 Respostas
+ 6
#Try this hour = int(input()) day = int(input()) # your code goes here if(hour<10 or hour>21) or (day==6 or day==7): print('Closed') else: print('Open')
4th Dec 2020, 6:25 AM
Simba
Simba - avatar
0
hour = int(input()) day = int(input()) # your code goes here if(hour<10 and hour>21): if(day==6 and day==7): print('Closed') else: print('Open')
4th Dec 2020, 4:35 AM
Abhishek Sinha
Abhishek Sinha - avatar