BbJLeB

08. Ski Trip

May 7th, 2019
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.05 KB | None | 0 0
  1. days = int(input())
  2. accommodation = input()
  3. feedback = input()
  4.  
  5. nights = days - 1
  6.  
  7. if accommodation == "room for one person":
  8.     discounted_price = nights * 18
  9. elif accommodation == "apartment":
  10.     if days < 10:
  11.         discount = 0.3
  12.         discounted_price = (nights * 25) * (1 - discount)
  13.     elif 10 <= days <= 15:
  14.         discount = 0.35
  15.         discounted_price = (nights * 25) * (1 - discount)
  16.     elif 15 < days:
  17.         discount = 0.5
  18.         discounted_price = (nights * 25) * (1 - discount)
  19. elif accommodation == "president apartment":
  20.     if days < 10:
  21.         discount = 0.1
  22.         discounted_price = (nights * 35) * (1 - discount)
  23.     elif 10 <= days <= 15:
  24.         discount = 0.15
  25.         discounted_price = (nights * 35) * (1 - discount)
  26.     elif 15 < days:
  27.         discount = 0.2
  28.         discounted_price = (nights * 35) * (1 - discount)
  29.  
  30. if feedback == "positive":
  31.     total_price = discounted_price * (1 + 0.25)
  32. elif feedback == "negative":
  33.     total_price = discounted_price * (1 - 0.1)
  34.  
  35. print(f"{total_price:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment