veronikaaa86

03. New House

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