BbJLeB

04. New House

May 7th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.52 KB | None | 0 0
  1. flower = input() # Roses, Dahlias Tulips, Narcissus ,Gladiolus
  2. quantity = int(input())
  3. budget = int(input())
  4.  
  5. flower_price = 0
  6. roses_price = 5
  7. dahlias_price = 3.80
  8. tulips_price = 2.80
  9. narcissus_price = 3
  10. gladiolus_price = 2.50
  11.  
  12. if flower == "Roses":
  13.     if quantity > 80:
  14.         flower_price = (roses_price - (roses_price * 0.1)) * quantity
  15.     elif quantity <= 80:
  16.         flower_price = roses_price * quantity
  17. elif flower == "Dahlias":
  18.     if quantity > 90:
  19.         flower_price = (dahlias_price - (dahlias_price * 0.15 )) * quantity
  20.     elif quantity <= 90:
  21.         flower_price = dahlias_price * quantity
  22. elif flower == "Tulips":
  23.     if quantity > 80:
  24.         flower_price = (tulips_price - (tulips_price * 0.15)) * quantity
  25.     elif quantity <= 80:
  26.         flower_price = tulips_price * quantity
  27. elif flower == "Narcissus":
  28.     if quantity < 120:
  29.         flower_price = (narcissus_price + (narcissus_price * 0.15 )) * quantity
  30.     elif quantity >= 120:
  31.         flower_price = narcissus_price * quantity
  32. elif flower == "Gladiolus":
  33.     if quantity < 80:
  34.         flower_price = (gladiolus_price + (gladiolus_price * 0.20 )) * quantity
  35.     elif quantity >= 80:
  36.         flower_price = gladiolus_price * quantity
  37. if flower_price <= budget:
  38.     end_budget = budget - flower_price
  39.     print(f"Hey, you have a great garden with {quantity} {flower} and {end_budget:.2f} leva left.")
  40. elif flower_price > budget:
  41.     end_budget = flower_price - budget
  42.     print(f"Not enough money, you need {end_budget:.2f} leva more.")
Add Comment
Please, Sign In to add comment