Spocoman

07.Working Hours

Dec 19th, 2021 (edited)
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. hour = int(input())
  2. day = input()
  3.  
  4. if (day == 'Monday' or day == 'Tuesday' or day == 'Wednesday' or day == 'Thursday'\
  5.         or day == 'Friday' or day == 'Saturday') and 10 <= hour <= 18:
  6.     print('open')
  7. else:
  8.     print('closed')
  9.  
  10. Или така:
  11.  
  12. hour = int(input())
  13. day = input()
  14.  
  15. if day in ('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday') and 10 <= hour <= 18:
  16.     print('open')
  17. else:
  18.     print('closed')
  19.  
  20.  
  21. Тарикатско решение:)
  22.  
  23. print('open' if 10 <= int(input()) <= 18 and (input()) != 'Sunday' else 'closed')
  24.  
Add Comment
Please, Sign In to add comment