Advertisement
exDotaPro

pc_club

Mar 4th, 2020
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. from operator import itemgetter
  2.  
  3. month = input()
  4. hours = int(input())
  5. people = int(input())
  6. day_time = input()
  7.  
  8. spring = ['march', 'april', 'may']
  9. summer = ['june', 'july', 'august']
  10. price = {'day': [10.50, 12.60], 'night': [8.40, 10.20]}
  11.  
  12. price_per_hour = 0
  13.  
  14. if month in spring:
  15.     price_per_hour = itemgetter(day_time)(price)[0]
  16.  
  17. elif month in summer:
  18.     price_per_hour = itemgetter(day_time)(price)[1]
  19.  
  20. if people >= 4:
  21.     price_per_hour *= 0.90
  22.  
  23. if hours >= 5:
  24.     price_per_hour *= 0.50
  25.  
  26. total = hours * price_per_hour * people
  27.  
  28. print(f'Price per person for one hour: {price_per_hour:.2f}')
  29. print(f'Total cost of the visit: {total:.2f}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement