dkyoseff

Conditional Statements - Exercise / 04. Toy Shop

Jul 9th, 2022 (edited)
838
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.80 KB | None | 0 0
  1. priceExcursion = float(input())
  2. numPuzzels = float(input())
  3. numDolls = float(input())
  4. numBears = float(input())
  5. numMinions = float(input())
  6. numTrucks = float(input())
  7.  
  8. pricePuzzel = 2.60
  9. priceDoll = 3
  10. priceBear = 4.10
  11. priceMinion = 8.20
  12. priceTruck = 2
  13.  
  14. price = numPuzzels * 2.60 + numDolls * 3 + numBears * 4.10 + numMinions * 8.20 + numTrucks * 2
  15. numberToys = numPuzzels + numDolls + numBears + numMinions + numTrucks
  16.  
  17. if numberToys >= 50:
  18.     discount = (price * 25) / 100
  19. else:
  20.     discount = 0
  21.  
  22. finalPrice = price - discount
  23. profit = finalPrice - ((finalPrice * 10) / 100)
  24.  
  25. if profit >= priceExcursion:
  26.     finalExit = profit - priceExcursion
  27.     print(f'Yes! {finalExit:.2f} lv left.')
  28. else:
  29.     needed = priceExcursion - profit
  30.     print(f'Not enough money! {needed:.2f} lv needed.')
  31.  
Add Comment
Please, Sign In to add comment