0
Guys im struggling this boolean exercise
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
6 odpowiedzi
0
hour = int(input())
day = int(input())
# your code goes here
if hour < 10 and day < 6:
print ("closed")
elif hour > 21 and day < 6:
print ("closed")
elif hour > 10 and day < 6:
print ("open")
0
Maybe u can better explain how im supposed to approach such a problem
0
Thank you, this makes so much sense, any avice on how i can improve my problem solving approach ?
0
Hi Mirielle i tried this code but still nothing, any idea where i might be getting it ol wrong ?
hour = int(input())
day = int(input())
# your code goes here
if (hour >= 10 and hour <=21):
if (day >=1 and day <=5):
print ("open")
else:
print ("closed")