Advertisement
go6odn28

Hotel_room_and_new_house

Oct 14th, 2023
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.02 KB | None | 0 0
  1. #New Hotel room_7
  2.  
  3. month = input()
  4. nights_num = int(input())
  5.  
  6. room_1 = ''
  7. room_2 = ''
  8. price_studio = 0
  9. price_apartment = 0
  10.  
  11. if month == 'May' or month == 'October':
  12.     room_1 = 'Studio'
  13.     room_2 = 'Apartment'
  14.     price_studio = 50 * nights_num
  15.     price_apartment = 65 * nights_num
  16.     if 7 < nights_num <= 14:
  17.         price_studio *= 0.95
  18.     elif nights_num > 14:
  19.         price_studio *= 0.70
  20.         price_apartment *= 0.9
  21. elif month == 'June' or month == 'September':
  22.     room_1 = 'Studio'
  23.     room_2 = 'Apartment'
  24.     price_studio = 75.20 * nights_num
  25.     price_apartment = 68.70 * nights_num
  26.     if nights_num > 14:
  27.         price_studio *= 0.80
  28.         price_apartment *= 0.9
  29. elif month == 'July' or month == 'August':
  30.     room_1 = 'Studio'
  31.     room_2 = 'Apartment'
  32.     price_studio = 76 * nights_num
  33.     price_apartment = 77 * nights_num
  34.     if nights_num > 14:
  35.         price_apartment *= 0.9
  36.  
  37. print(f"Apartment: {price_apartment:.2f} lv.")
  38. print(f"Studio: {price_studio:.2f} lv.")
  39.  
  40.  
  41.  
  42.  
  43. # new house_3
  44.  
  45. flowers = input()
  46. num_flowers = int(input())
  47. budget = int(input())
  48. price = 0
  49.  
  50. if flowers == 'Roses':
  51.     if num_flowers > 80:
  52.         price = 5 * num_flowers * 0.90
  53.     else:
  54.         price = 5 * num_flowers
  55. elif flowers == 'Dahlias':
  56.     if num_flowers > 90:
  57.         price = 3.80 * num_flowers * 0.85
  58.     else:
  59.         price = 3.80 * num_flowers
  60. elif flowers == 'Tulips':
  61.     if num_flowers > 80:
  62.         price = 2.80 * num_flowers * 0.85
  63.     else:
  64.         price = 2.80 * num_flowers
  65. elif flowers == 'Narcissus':
  66.     if num_flowers < 120:
  67.         price = 3 * num_flowers * 1.15
  68.     else:
  69.         price = 3 * num_flowers
  70. elif flowers == 'Gladiolus':
  71.     if num_flowers < 80:
  72.         price = 2.50 * num_flowers * 1.20
  73.     else:
  74.         price = 2.50 * num_flowers
  75.  
  76. diff = abs(price - budget)
  77. if budget >= price:
  78.     print(f'Hey, you have a great garden with {num_flowers} {flowers} and {diff:.2f} leva left.')
  79. else:
  80.     print(f"Not enough money, you need {diff:.2f} leva more.")
  81.  
  82.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement