ProdanTenev

ToyShop

Feb 13th, 2021 (edited)
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.82 KB | None | 0 0
  1. price_puzzle = 2.60
  2. price_talking_doll = 3.00
  3. price_bear = 4.10
  4. price_minion = 8.20
  5. price_truck = 2.00
  6.  
  7. rest = float(input())
  8. puzzles = int(input())
  9. talking_dolls = int(input())
  10. bears = int(input())
  11. minions = int(input())
  12. trucks = int(input())
  13.  
  14. sum_toys = price_puzzle * puzzles + price_talking_doll * talking_dolls + price_bear * bears + price_minion * minions + price_truck * trucks
  15. pieces_toys = puzzles + talking_dolls + bears + minions + trucks
  16.  
  17. if pieces_toys > 50:
  18.     discount = sum_toys * 0.25
  19.     final_price = sum_toys - discount
  20. else:
  21.     final_price = sum_toys
  22.  
  23. profit = final_price - (final_price * 0.10)
  24.  
  25. if profit > rest:
  26.     sum_profit = profit - rest
  27.     print(f"Yes! {sum_profit:.2f} lv left.")
  28. else:
  29.     money_left = rest - profit
  30.     print(f"Not enough money! {money_left:.2f} lv needed.")
Add Comment
Please, Sign In to add comment