webbersof

Ski Trip

Jul 26th, 2023
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.19 KB | None | 0 0
  1. days_for_stay = int(input())
  2. type_of_room = input()
  3. rating = input()
  4. costs = 0
  5. days_for_stay -= 1
  6.  
  7. if days_for_stay < 10:
  8.     if type_of_room == 'room for one person':
  9.         costs = 18 * days_for_stay
  10.     elif type_of_room == 'apartment':
  11.         costs = 25 * days_for_stay
  12.         costs -= costs * 0.30
  13.     elif type_of_room == 'president apartment':
  14.         costs = 35 * days_for_stay
  15.         costs -= costs * 0.10
  16.  
  17. elif 10 <= days_for_stay <= 15:
  18.     if type_of_room == 'room for one person':
  19.         costs = 18 * days_for_stay
  20.     elif type_of_room == 'apartment':
  21.         costs = 25 * days_for_stay
  22.         costs -= costs * 0.35
  23.     elif type_of_room == 'president apartment':
  24.         costs = 35 * days_for_stay
  25.         costs -= costs * 0.15
  26.  
  27. elif days_for_stay > 15:
  28.     if type_of_room == 'room for one person':
  29.         costs = 18 * days_for_stay
  30.     elif type_of_room == 'apartment':
  31.         costs = 25 * days_for_stay
  32.         costs -= costs * 0.50
  33.     elif type_of_room == 'president apartment':
  34.         costs = 35 * days_for_stay
  35.         costs -= costs * 0.20
  36.  
  37.  
  38. if rating == 'positive':
  39.     costs += costs * 0.25
  40. else:
  41.     costs -= costs * 0.10
  42.  
  43. print(f'{costs:.2f}')
Add Comment
Please, Sign In to add comment