0
Булева логика
Помогите пожалуйста, никак не могу понять почему не работает https://sololearn.com/coach/123/?ref=app hour = int(input()) day = int(input()) if hour >=10 and hour <=21 or day >=1 and day <=5: print("Open") else: print("Closed")
8 Answers
+ 2
Рамин Барциц
Solved (see below code )
You need and operator in between because both hours and day condition should be followed according to your question.
Then you have to print closed/open : )
hour = int(input())
day = int(input())
if (10 <= hour <= 21) and (1 <= day <= 5):
print("Open")
else:
print("Closed")
+ 2
Рамин Барциц Try This
hour = int(input())
day = int(input())
if (hour >=10 and hour <=21) or (day >=1 and day <=5):
print("Open")
else:
print("Closed")
Tell me if it works : )
bcz i can't see the question
If u can plz post the question also : )
+ 1
if hour <= 20 and day <= 5:
print("Open")
else:
print("Closed")
0
Unfortunately didn't work either;(
You need to create a program that displays the state of the store Open or Closed depending on the time and day of the week.
The store is open daily from 10 am to 9 pm, except Saturday and Sunday.
You need to add the hour and day of the week as input.
The day of the week is represented as an integer (1 for Monday, 2 for Tuesday, etc.)
0
does not work when entering Saturday and Sunday (6-7 days)
0
Brilliant! Thank you very much!!!
0
Welcome Рамин Барциц
Hope u learn from above code
But i reccomend u to keep learning and try and try untill u didn't solve it by yourself
0
of course!