Advertisement
Vanchella

[Python]hotel_room_book

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