Advertisement
anton_d

04.toy_shop

Jan 20th, 2022 (edited)
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.72 KB | None | 0 0
  1. p_trip = float(input())
  2. qpuzzles = int(input())
  3. qdolls = int(input())
  4. qteddies = int(input())
  5. qminions = int(input())
  6. qtrucks = int(input())
  7.  
  8. p_puzzle = qpuzzles * 2.60
  9. p_dolls = qdolls * 3.00
  10. p_teddies = qteddies * 4.10
  11. p_minions = qminions * 8.20
  12. p_trucks = qtrucks * 2.00
  13.  
  14. q_total = qpuzzles + qdolls + qteddies + qminions + qtrucks
  15. p_total = p_trucks + p_minions + p_puzzle + p_teddies + p_dolls
  16.  
  17. if q_total >= 50:
  18.     p_total = p_total * 0.75
  19.  
  20. rent = p_total - (p_total * 0.90)
  21.  
  22. profit = p_total - rent
  23.  
  24. money_left = profit - p_trip
  25.  
  26. if profit >= p_trip:
  27.     print(f"Yes! {money_left:.2f} lv left.")
  28. else:
  29.     money_left = abs(money_left)
  30.     print(f"Not enough money! {money_left:.2f} lv needed.")
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement