Lyubohd

03. New House

Jun 20th, 2021
625
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. flower_type = input()
  2. flower_cnt = int(input())
  3. budget = int(input())
  4.  
  5. price = 0
  6.  
  7. if flower_type == 'Roses':
  8.     price = 5
  9.     if flower_cnt > 80:
  10.         price = price * 0.9
  11. elif flower_type == 'Dahlias':
  12.     price = 3.80
  13.     if flower_cnt > 90:
  14.         price = price * 0.85
  15. elif flower_type == 'Tulips':
  16.     price = 2.80
  17.     if flower_cnt > 80:
  18.         price = price * 0.85
  19. elif flower_type == 'Narcissus':
  20.     price = 3
  21.     if flower_cnt < 120:
  22.         price = price * 1.15
  23. elif flower_type == 'Gladiolus':
  24.     price = 2.50
  25.     if flower_cnt < 80:
  26.         price = price * 1.2
  27.  
  28. total_price = flower_cnt * price
  29. if budget >= total_price:
  30.     money_left = budget - total_price
  31.     print(f"Hey, you have a great garden with {flower_cnt} {flower_type} and {money_left:.2f} leva left.")
  32. else:
  33.     money_need = total_price - budget
  34.     print(f"Not enough money, you need {money_need:.2f} leva more.")
  35.  
RAW Paste Data