desislava_topuzakova

13. Ski Trip

Feb 21st, 2021
803
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. days = int(input())
  2. type_room = input()
  3. opinion = input()
  4.  
  5. #1. крайна цена = бр. нощувки (дни - 1) * цена за 1 нощувка (стаята)
  6. # 2. отстъпка спрямо дните и стаята
  7. # 3. отстъпка спрямо оценката(мнението)
  8. # 4. печатаме сумата
  9.  
  10. #крайна цена
  11. nights = days - 1
  12. price_per_night = 0
  13.  
  14. if type_room == "room for one person":
  15.     price_per_night = 18
  16. elif type_room == "apartment":
  17.     price_per_night = 25
  18. elif type_room == "president apartment":
  19.     price_per_night = 35
  20.  
  21. total_price = nights * price_per_night # крайна цена без намаление
  22.  
  23.  
  24. # намаление 1
  25. if type_room == "apartment":
  26.     if days < 10:
  27.         total_price = total_price - 0.30 * total_price
  28.         #total_price = 0.7 * total_price
  29.     elif 10 <= days <= 15:
  30.         total_price = total_price - 0.35 * total_price
  31.         # total_price = 0.65 * total_price
  32.     elif days > 15:
  33.         total_price = total_price - 0.50 * total_price
  34.         # total_price = 0.50 * total_price
  35. elif type_room == "president apartment":
  36.     if days < 10:
  37.         total_price = total_price - 0.10 * total_price
  38.         # total_price = 0.9 * total_price
  39.     elif 10 <= days <= 15:
  40.         total_price = total_price - 0.15 * total_price
  41.         # total_price = 0.85 * total_price
  42.     elif days > 15:
  43.         total_price = total_price - 0.20 * total_price
  44.         # total_price = 0.80 * total_price
  45.  
  46. # намаление 2
  47. if opinion == "positive":
  48.     total_price = total_price + 0.25 * total_price
  49.     # total_price = 1.25 * total_price
  50. elif opinion == "negative":
  51.     total_price = total_price - 0.10 * total_price
  52.     # total_price = 0.9 * total_price
  53.  
  54.  
  55. print(f"{total_price:.2f}")
RAW Paste Data