Advertisement
PowerCell46

Ski trip Python

Dec 16th, 2022
615
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.08 KB | None | 0 0
  1. number_of_days = int(input()) - 1
  2. room_type = str(input())
  3. review = str(input())
  4. price = 0
  5. discount = 0
  6.  
  7. if room_type == "room for one person":
  8.     price = 18
  9.  
  10.     if number_of_days < 10:
  11.         discount = 0
  12.     elif number_of_days >= 10 and number_of_days <= 15:
  13.         discount = 0
  14.     elif number_of_days > 15:
  15.         discount = 0
  16.  
  17.  
  18. elif room_type == "apartment":
  19.     price = 25
  20.  
  21.  
  22.     if number_of_days < 10:
  23.         discount = 30
  24.     elif number_of_days >= 10 and number_of_days <= 15:
  25.         discount = 35
  26.     elif number_of_days > 15:
  27.         discount = 50
  28.  
  29. elif room_type == "president apartment":
  30.     price = 35
  31.  
  32.  
  33.     if number_of_days < 10:
  34.         discount = 10
  35.     elif number_of_days >= 10 and number_of_days <= 15:
  36.         discount = 15
  37.     elif number_of_days > 15:
  38.         discount = 20
  39.  
  40. sum = price * number_of_days - ((price * number_of_days / 100) * discount)
  41.  
  42. if review == "positive":
  43.     discount = 25
  44.     sum += ((sum / 100) * discount)
  45. elif review == "negative":
  46.     discount = 10
  47.     sum -= ((sum / 100) * discount)
  48.  
  49. print(f'{sum:.2f}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement