Advertisement
omnilog

08. Hotel Room

Oct 5th, 2019
857
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.37 KB | None | 0 0
  1. months = input()
  2. nights = int(input())
  3.  
  4. studio_total_price = 0
  5. apartment_total_price = 0
  6. # Apartment
  7. if 1 <= nights <= 14:
  8.     if months == 'May' or months == 'October':
  9.         apartment_total_price = nights * 65
  10.     elif months == 'June' or months == 'September':
  11.         apartment_total_price = nights * 68.7
  12.     elif months == 'July' or months == 'August':
  13.         apartment_total_price = nights * 77
  14. if nights > 14:
  15.     if months == 'May' or months == 'October':
  16.         apartment_total_price = nights * 65 - nights * 65 * 0.1
  17.     elif months == 'June' or months == 'September':
  18.         apartment_total_price = nights * 68.7 - nights * 68.7 * 0.1
  19.     elif months == 'July' or months == 'August':
  20.         apartment_total_price = nights * 77 - nights * 77 * 0.1
  21. print(f"Apartment: {apartment_total_price:.2f} lv.")
  22. # Studio
  23. if months == 'May' or months == 'October':
  24.     if 7 < nights <= 14:
  25.         studio_total_price = nights * 50 - nights * 50 * 0.05
  26.     elif nights > 14:
  27.         studio_total_price = nights * 50 - nights * 50 * 0.3
  28. if months == 'June' or months == 'September':
  29.     if 1 <= nights <= 14:
  30.         studio_total_price = nights * 75.2
  31.     elif nights > 14:
  32.         studio_total_price = nights * 75.2 - nights * 75.2 * 0.2
  33. if months == 'July' or months == 'August':
  34.     studio_total_price = nights * 76
  35. print(f"Studio: {studio_total_price:.2f} lv.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement