Advertisement
HristoBaychev

hotel room

Jan 21st, 2023
1,232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.44 KB | None | 0 0
  1. month = input()
  2. nights = int(input())
  3.  
  4. price_flat = 0.00
  5. price_studio = 0.00
  6. studio = 0.00
  7. flat = 0.00
  8.  
  9. if month == 'May' or month == 'October':
  10.     studio = 50
  11.     flat = 65
  12. elif month == 'June' or month == "September":
  13.     studio = 75.20
  14.     flat = 68.70
  15. elif month == 'July' or month == 'August':
  16.     studio = 76
  17.     flat = 77
  18.  
  19. if month == 'May' or month == 'October':
  20.     if 7 < nights < 14:
  21.         price_studio = (studio * nights) * 0.95
  22.     elif nights > 14:
  23.         price_studio = (studio * nights) * 0.70
  24.     else:
  25.         price_studio = studio * nights
  26.  
  27. if month == 'May' or month == 'October':
  28.     if 7 < nights <= 14:
  29.         price_flat = flat * nights
  30.     elif nights > 14:
  31.         price_flat = (flat * nights) * 0.90
  32.     else:
  33.         price_flat = flat * nights
  34.  
  35. if month == 'June' or month == 'September':
  36.     if nights > 14:
  37.         price_studio = (studio * nights) * 0.80
  38.     else:
  39.         price_studio = studio * nights
  40.  
  41. if month == 'June' or month == 'September':
  42.     if nights > 14:
  43.         price_flat = (flat * nights) * 0.90
  44.     else:
  45.         price_flat = flat * nights
  46.  
  47. if month == 'July' or month == 'August':
  48.     price_studio = studio * nights
  49.  
  50. if month == 'July' or month == 'August':
  51.     if nights > 14:
  52.         price_flat = (flat * nights) * 0.90
  53.     else:
  54.         price_flat = flat * nights
  55.  
  56.  
  57. print(f'Apartment: {price_flat:.2f} lv.')
  58. print(f'Studio: {price_studio:.2f} lv.')
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement