Ddimov90

new_house_03_02

Sep 24th, 2025
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.10 KB | Source Code | 0 0
  1. flower_type = input()
  2. quantity_flowers = int(input())
  3. budget = int(input())
  4.  
  5. total = 0
  6. roses_price = 5
  7. dahlias_price = 3.8
  8. tulip_price = 2.8
  9. narcissus_price = 3
  10. gladiolus_price = 2.5
  11.  
  12. if flower_type == "Roses":
  13.     total = quantity_flowers * roses_price
  14.     if quantity_flowers > 80:
  15.         total -= total * 0.1
  16.  
  17. elif flower_type == "Dahlias":
  18.     total = quantity_flowers * dahlias_price
  19.     if quantity_flowers > 90:
  20.         total -= total * 0.15
  21.  
  22. elif flower_type == "Tulips":
  23.     total = quantity_flowers * tulip_price
  24.     if quantity_flowers > 80:
  25.         total -= total * 0.15
  26.  
  27. elif flower_type == "Narcissus":
  28.     total = quantity_flowers * narcissus_price
  29.     if quantity_flowers < 120:
  30.         total += total * 0.15
  31.  
  32. elif flower_type == "Gladiolus":
  33.     total = quantity_flowers * gladiolus_price
  34.     if quantity_flowers < 80:
  35.         total += total * 0.2
  36.  
  37. if budget >= total:
  38.     print(f"Hey, you have a great garden with {quantity_flowers} {flower_type} and {budget - total:.2f} leva left.")
  39. else:
  40.     print(f"Not enough money, you need {total - budget:.2f} leva more.")
  41.  
  42.  
  43.  
  44.  
Advertisement
Add Comment
Please, Sign In to add comment