Advertisement
simeonshopov

New house - garden

Oct 1st, 2019
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.73 KB | None | 0 0
  1. flowers = input()
  2. count = int(input())
  3. budget = int(input())
  4.  
  5. price = 0
  6.  
  7. type = ["Roses", "Dahilias", "Tulips", "Narcissus", "Gladiolus"]
  8. prices = [5, 3.80, 2.80, 3, 2.50]
  9.  
  10. if flowers in type:
  11.   index = type.index(flowers)
  12.   price = count * prices[index]
  13.  
  14. if flowers == type[0] and count > 80:
  15.   price *= 0.9
  16. elif (flowers == type[1] and count > 90) or (flowers == type[2] and count > 80):
  17.   price *= 0.85
  18. elif flowers == type[3] and count < 120:
  19.   price *= 1.15
  20. elif flowers == type[4] and count < 80:
  21.   price *=1.2
  22.  
  23. if budget >= price:
  24.   print(f"Hey, you have a great garden with {count} {flowers} and {(budget - price):.2f} leva left.")
  25. else:
  26.   print(f"Not enough money, you need {(price - budget):.2f} leva more.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement