Sichanov

hotel

Aug 6th, 2021
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.87 KB | None | 0 0
  1. month = str(input().lower()).strip()
  2. nights = int(input())
  3.  
  4. studio = {
  5.     "may": 50,
  6.     "october": 50,
  7.     "june": 75.20,
  8.     "september": 75.20,
  9.     "july": 76,
  10.     "august": 76
  11. }
  12.  
  13. apartment = {
  14.     "may": 65,
  15.     "october": 65,
  16.     "june": 68.70,
  17.     "september": 68.70,
  18.     "july": 77,
  19.     "august": 77
  20. }
  21.  
  22. cost_studio = float(studio.get(month, "") * nights)
  23. cost_apart = float(apartment.get(month, "") * nights)
  24.  
  25. if (nights in range(8, 15)) and (month in ("may october")):
  26.     discount = 0.95
  27.     cost_studio *= discount
  28.  
  29. elif (nights > 14) and (month in ("may october")):
  30.     discount = 0.70
  31.     cost_studio *= discount
  32.  
  33. elif (nights > 14) and (month in ("june september")):
  34.     discount = 0.80
  35.     cost_studio *= discount
  36.  
  37. if nights > 14:
  38.     cost_apart *= 0.9
  39.  
  40. print(f"Apartment: {cost_apart:.2f} lv.")
  41. print(f"Studio: {cost_studio:.2f} lv.")
  42.  
Advertisement
Add Comment
Please, Sign In to add comment