George_Ivanov05

toy shop

Feb 15th, 2021
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.18 KB | None | 0 0
  1. # 1. pechalba =  pechalba ot puzelite + pechalba ot kukli + pechalba ot mechetata + pechalba ot minionite
  2. # + pechalba ot kamionchetata
  3. # 2. otstypka -> obsht broi na igrachkite >= 50 ->pechalba - 25%
  4. # 3. Naem = 10% ot pechalbata
  5. # 4. prowerka dali pechalbata shte stigen za ekskurziq
  6.  
  7. trip_price = float(input())
  8. puzzles_count = int(input())
  9. dolls_count = int(input())
  10. bears_count = int(input())
  11. minions_count = int(input())
  12. trucks_count = int(input())
  13.  
  14. #pechalba
  15. profit = (puzzles_count * 2.60) + (dolls_count * 3) + (bears_count * 4.10) + (minions_count * 8.20) + (trucks_count * 2)
  16.  
  17. #otstypka
  18. total_count = puzzles_count + dolls_count + bears_count + minions_count + trucks_count
  19.  
  20. if total_count >= 50:
  21.     profit = profit - 0.25 * profit  # 0.75 * profit
  22.  
  23. #naem
  24. rent = profit * 0.10
  25. profit = profit - rent  #profit -= rent
  26.  
  27. # prowerka za ekskurziqta
  28. # ako parite sa dostatuchni -> profit >= trip_price
  29.  
  30. if profit >= trip_price:
  31.     left_money = profit - trip_price
  32.     print(f"Yes! {left_money:.2f} lv left.")
  33. else:
  34.     # ne sa dostatuchni
  35.     # profit < trip_price
  36.     need_money = trip_price - profit
  37.     print(f"Not enough money! {need_money:.2f} lv needed.")
  38.  
  39.  
Advertisement
Add Comment
Please, Sign In to add comment