Advertisement
HristoBaychev

sky trip

Jan 21st, 2023
881
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.39 KB | None | 0 0
  1. day_for_rest = int(input())
  2. accommodation = input()
  3. grade = input()
  4.  
  5. room = 18
  6. apartment = 25
  7. president_apartment = 35
  8.  
  9. day_for_rest = day_for_rest - 1
  10.  
  11. final_price = 0
  12.  
  13. if accommodation == 'room for one person':
  14.     final_price = room * day_for_rest
  15.  
  16. if day_for_rest < 10 and accommodation == 'apartment':
  17.     apartment = apartment * 0.70
  18.     final_price = apartment * day_for_rest
  19. elif 10 <= day_for_rest <= 15 and accommodation == 'apartment':
  20.     apartment = apartment * 0.65
  21.     final_price = apartment * day_for_rest
  22. elif day_for_rest > 15 and accommodation == 'apartment':
  23.     apartment = apartment * 0.50
  24.     final_price = apartment * day_for_rest
  25.  
  26. if day_for_rest < 10 and accommodation == 'president apartment':
  27.     president_apartment = president_apartment * 0.90
  28.     final_price = president_apartment * day_for_rest
  29. elif 10 <= day_for_rest <= 15 and accommodation == 'president apartment':
  30.     president_apartment = president_apartment * 0.85
  31.     final_price = president_apartment * day_for_rest
  32. elif day_for_rest > 15 and accommodation == 'president apartment':
  33.     president_apartment = president_apartment * 0.80
  34.     final_price = president_apartment * day_for_rest
  35.  
  36. if grade == 'positive':
  37.     grade_price = final_price * 0.25
  38.     final_price = grade_price + final_price
  39. elif grade == 'negative':
  40.     final_price = final_price * 0.90
  41.  
  42. print(f'{final_price:.2f}')
  43.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement