Advertisement
Guest User

pc_club

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