Advertisement
mark79

New House

Jan 28th, 2020
614
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1. flower = input()
  2. qty = int(input())
  3. budget = int(input())
  4.  
  5. flower_price = 0
  6. if flower == "Roses":
  7.     flower_price = 5 * 0.9 if qty > 80 else 5
  8. elif flower == "Dahlias":
  9.     flower_price = 3.8 * 0.85 if qty > 90 else 3.8
  10. elif flower == "Tulips":
  11.     flower_price = 2.8 * 0.85 if qty > 80 else 2.8
  12. elif flower == "Narcissus":
  13.     flower_price = 3 * 1.15 if qty < 120 else 3
  14. elif flower == "Gladiolus":
  15.     flower_price = 2.5 * 1.2 if qty < 80 else 2.5
  16.  
  17. total_price = qty * flower_price
  18. result = abs(total_price - budget)
  19.  
  20. if total_price > budget:
  21.     print(f"Not enough money, you need {result:.2f} leva more.")
  22. else:
  23.     print(f"Hey, you have a great garden with {qty} {flower} and {result:.2f} leva left.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement