Advertisement
veronikaaa86

03. New House

Jul 16th, 2023
993
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.04 KB | None | 0 0
  1. # "Roses", "Dahlias", "Tulips", "Narcissus" или "Gladiolus"
  2. type_flowers = input()
  3. count_flowers = int(input())
  4. budget = int(input())
  5.  
  6. total_sum = 0
  7. if type_flowers == "Roses":
  8.     total_sum = 5 * count_flowers
  9.     if count_flowers > 80:
  10.         total_sum = total_sum * 0.9
  11. elif type_flowers == "Dahlias":
  12.     total_sum = 3.8 * count_flowers
  13.     if count_flowers > 90:
  14.         total_sum = total_sum * 0.85
  15. elif type_flowers == "Tulips":
  16.     total_sum = 2.8 * count_flowers
  17.     if count_flowers > 80:
  18.         total_sum = total_sum * 0.85
  19. elif type_flowers == "Narcissus":
  20.     total_sum = 3 * count_flowers
  21.     if count_flowers < 120:
  22.         total_sum = total_sum * 1.15
  23. elif type_flowers == "Gladiolus":
  24.     total_sum = 2.5 * count_flowers
  25.     if count_flowers < 80:
  26.         total_sum = total_sum * 1.20
  27.  
  28. diff = abs(total_sum - budget)
  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