Sichanov

ski trip

Jun 9th, 2021 (edited)
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.31 KB | None | 0 0
  1. days = int(input())
  2. type = input()
  3. opinion = input()
  4. price = 0
  5. price1 = 0
  6. if type == 'room for one person':
  7.     if opinion == 'positive':
  8.         price = (days - 1) * 18 * 1.25
  9.     elif opinion == 'negative':
  10.         price = (days - 1) * 18 * 0.9
  11. elif type == 'apartment':
  12.     if opinion == 'positive':
  13.         if days <= 10:
  14.             price1 = 25 * 0.7
  15.         elif 10 < days <= 15:
  16.             price1 = 25 * 0.65
  17.         elif days > 15:
  18.             price1 = 25 * 0.5
  19.         price = (days - 1) * price1 * 1.25
  20.     elif opinion == 'negative':
  21.         if days <= 10:
  22.             price1 = 25 * 0.7
  23.         elif 10 < days <= 15:
  24.             price1 = 25 * 0.65
  25.         elif days > 15:
  26.             price1 = 25 * 0.5
  27.         price = (days - 1) * price1 * 0.9
  28. elif type == 'president apartment':
  29.     if opinion == 'positive':
  30.         if days <= 10:
  31.             price1 = 35 * 0.9
  32.         elif 10 < days <= 15:
  33.             price1 = 35 * 0.85
  34.         elif days > 15:
  35.             price1 = 35 * 0.8
  36.             price = (days - 1) * price1 * 1.25
  37.     elif opinion == 'negative':
  38.         if days <= 10:
  39.             price1 = 35 * 0.9
  40.         elif 10 < days <= 15:
  41.             price1 = 35 * 0.85
  42.         elif days > 15:
  43.             price1 = 35 * 0.8
  44.         price = (days - 1) * price1 * 0.9
  45. print(f'{price:.2f}')
Add Comment
Please, Sign In to add comment