rozalina1988

New_house

Oct 29th, 2024
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.13 KB | Source Code | 0 0
  1. flowers_type = input()
  2. flowers_count = float(input())
  3. budget = float(input())
  4.  
  5. discount = 0.0
  6. flowers_cost = 0.0
  7.  
  8.  
  9. if flowers_type == "Roses":
  10.     flowers_cost = flowers_count * 5
  11.     if flowers_count > 80 :
  12.         flowers_cost *= 0.10
  13.  
  14. elif flowers_type == "Dahlias":
  15.     flowers_cost = flowers_count * 3.8
  16.     if flowers_count > 90 :
  17.         flowers_cost *= 0.15
  18.  
  19. elif flowers_type == "Tulips":
  20.     flowers_cost = flowers_count * 2.8
  21.     if flowers_count > 80 :
  22.         flowers_cost *= 0.15
  23.  
  24. elif flowers_type ==  "Narcissus":
  25.     flowers_cost = flowers_count * 3
  26.     if flowers_count < 120:
  27.         flowers_cost = flowers_cost + (flowers_cost * 0.15)
  28. elif flowers_type == "Gladiolus":
  29.     flowers_cost = flowers_count * 2.5
  30.     if flowers_count < 80:
  31.         flowers_cost = flowers_cost + (flowers_cost * 0.20)
  32.  
  33. if budget >= flowers_cost :
  34.     money_left = budget - flowers_cost
  35.     print(f"Hey, you have a great garden with {flowers_count} {flowers_type} and {money_left:.2f} leva left.")
  36. else:
  37.     money_needed = budget - flowers_cost
  38.     print(f"Not enough money, you need {abs(money_needed):.2f} leva more.")
  39.  
  40.  
  41.  
Advertisement
Add Comment
Please, Sign In to add comment