Advertisement
Guest User

ski_trip

a guest
Jan 27th, 2020
1,186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.63 KB | None | 0 0
  1. days = int(input()) - 1
  2. room_type = input()
  3. opinion = input()
  4.  
  5. price = 0
  6.  
  7. if room_type == 'room for one person':
  8.     price = 18
  9. elif room_type == 'apartment':
  10.     price = 25
  11.     if days > 15:
  12.         price *= 0.50
  13.     elif days >= 10:
  14.         price *= 0.65
  15.     else:
  16.         price *= 0.70
  17. elif room_type == 'president apartment':
  18.     price = 35
  19.     if days > 15:
  20.         price *= 0.80
  21.     elif days >= 10:
  22.         price *= 0.85
  23.     else:
  24.         price *= 0.90
  25.  
  26. if opinion == 'positive':
  27.     price *= 1.25
  28. elif opinion == 'negative':
  29.     price *= 0.90
  30.  
  31. total_price = price * days
  32.  
  33. print(f'{total_price:.2f}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement