Advertisement
GalinaKG

Untitled

May 11th, 2022
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. type_flowers = input()
  2. count_flowers = int(input())
  3. budget = int(input())
  4. total_sum = 0
  5.  
  6. if type_flowers == 'Roses':
  7. total_sum = 5 * count_flowers
  8. if count_flowers > 80:
  9. total_sum -= (total_sum * 0.10)
  10. elif type_flowers == 'Dahlias':
  11. total_sum = 3.80 * count_flowers
  12. if count_flowers > 90:
  13. total_sum -= (total_sum * 0.15)
  14. elif type_flowers == 'Tulips':
  15. total_sum = 2.80 * count_flowers
  16. if count_flowers > 80:
  17. total_sum -= (total_sum * 0.15)
  18. elif type_flowers == 'Narcissus':
  19. total_sum = 3 * count_flowers
  20. if count_flowers < 120:
  21. total_sum += (total_sum * 0.15)
  22. else:
  23. total_sum = 2.50 * count_flowers
  24. if count_flowers < 80:
  25. total_sum += (total_sum * 0.20)
  26.  
  27. diff = abs(budget - total_sum)
  28.  
  29. if budget >= total_sum:
  30. print(f"Hey, you have a great garden with {count_flowers} {type_flowers} and {diff:.2f} leva left.")
  31. else:
  32. print(f"Not enough money, you need {diff:.2f} leva more.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement