Advertisement
PowerCell46

Hotel Room Python

Dec 16th, 2022
642
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.24 KB | None | 0 0
  1. month = str(input())
  2. number_of_nights = int(input())
  3. studio_price_for_a_night = 0
  4. apartment_price_for_a_night = 0
  5. studio_discount = 0
  6. apartment_discount = 0
  7.  
  8. if month == "May" or month == "October":
  9.     studio_price_for_a_night = 50
  10.     apartment_price_for_a_night = 65
  11.     if number_of_nights > 7 and number_of_nights <= 14:
  12.         studio_discount = 5
  13.     elif number_of_nights > 14:
  14.         studio_discount = 30
  15.         apartment_discount = 10
  16.  
  17. elif month == "June" or month == "September":
  18.     studio_price_for_a_night = 75.20
  19.     apartment_price_for_a_night = 68.70
  20.     if number_of_nights > 14:
  21.         studio_discount = 20
  22.         apartment_discount = 10
  23.  
  24. elif month == "July" or month == "August":
  25.     studio_price_for_a_night = 76
  26.     apartment_price_for_a_night = 77
  27.     if number_of_nights > 14:
  28.         apartment_discount = 10
  29.  
  30.  
  31. apartment_final_price = (apartment_price_for_a_night * number_of_nights) - ((apartment_price_for_a_night * number_of_nights / 100) * apartment_discount)
  32. print(f'Apartment: {apartment_final_price:.2f} lv.')
  33.  
  34. studio_final_price = (studio_price_for_a_night * number_of_nights) - ((studio_price_for_a_night * number_of_nights / 100) * studio_discount)
  35. print(f'Studio: {studio_final_price:.2f} lv.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement