Advertisement
Guest User

Untitled

a guest
Jul 25th, 2021
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.06 KB | None | 0 0
  1. month = input()
  2. number_of_nights = int(input())
  3. cost_for_apartment = 0
  4. cost_for_studio = 0
  5.  
  6. if month == 'May' or month == 'October':
  7.     cost_for_apartment = 65 * number_of_nights
  8.     cost_for_studio = 50 * number_of_nights
  9.  
  10.     if 7 < number_of_nights <= 14:
  11.         cost_for_studio = cost_for_studio * 0.95
  12.  
  13.     if number_of_nights > 14:
  14.         cost_for_studio -= cost_for_studio * 0.30
  15.         cost_for_apartment -= cost_for_apartment * 0.10
  16.  
  17. elif month == 'June' or month == 'September':
  18.     cost_for_studio = 75.20 * number_of_nights
  19.     cost_for_apartment = 68.70 * number_of_nights
  20.  
  21.     if number_of_nights > 14:
  22.         cost_for_studio -= cost_for_studio * 0.20
  23.         cost_for_apartment -= cost_for_apartment * 0.10
  24.  
  25. elif month == 'July' or month == 'August':
  26.     cost_for_studio = 76 * number_of_nights
  27.     cost_for_apartment = 77 * number_of_nights
  28.  
  29.     if number_of_nights > 14:
  30.         cost_for_apartment -= cost_for_apartment * 0.10
  31.  
  32. print(f'Apartment: {cost_for_apartment:.2f} lv.')
  33. print(f'Studio: {cost_for_studio:.2f} lv.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement