Spocoman

08.Cinema Ticket

Dec 20th, 2021 (edited)
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.74 KB | None | 0 0
  1. day = input()
  2.  
  3. price = 0
  4.  
  5. if day == 'Monday' or day == 'Tuesday' or day == 'Friday':
  6.     price = 12
  7. elif day == 'Wednesday' or day == 'Thursday':
  8.     price = 14
  9. else:
  10.     price = 16
  11.  
  12. print(price)
  13.  
  14. ИЛИ:
  15.  
  16. day = input()
  17.  
  18. price = 0
  19.  
  20. if day in ('Monday', 'Tuesday', 'Friday'):
  21.     price = 12
  22. elif day in ('Wednesday', 'Thursday'):
  23.     price = 14
  24. else:
  25.     price = 16
  26.  
  27. print(price)
  28.  
  29. ИЛИ:
  30.  
  31. day = input()
  32. day_ticket_price = {'Monday': 12, 'Tuesday': 12, 'Wednesday': 14, 'Thursday': 14, 'Friday':12, 'Saturday': 16, 'Sunday': 16}
  33. print(day_ticket_price.get(day))
  34.  
  35. Или тарикатската:)
  36.  
  37. print({'Monday': 12, 'Tuesday': 12, 'Wednesday': 14, 'Thursday': 14, 'Friday': 12, 'Saturday': 16, 'Sunday': 16}[(input())])
  38.  
Add Comment
Please, Sign In to add comment