Advertisement
Tsenkov

4. Магазин за детски играчки

Jul 14th, 2022
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.06 KB | None | 0 0
  1. trip_price = float(input())
  2. puzzles = int(input())
  3. talking_dolls = int(input())
  4. teddy_bears = int(input())
  5. minions = int(input())
  6. trucks = int(input())
  7. puzzle_price = 2.60
  8. talking_dolls_price = 3
  9. teddy_bear_price = 4.10
  10. minions_price = 8.20
  11. truck_price = 2
  12. discount = 0.25
  13. puzzles_sum = puzzles * puzzle_price
  14. talking_dolls_sum = talking_dolls * talking_dolls_price
  15. teddy_bears_sum = teddy_bears*teddy_bear_price
  16. minions_sum = minions * minions_price
  17. trucks_sum = trucks * truck_price
  18. order = puzzles_sum + talking_dolls_sum + teddy_bears_sum + minions_sum + trucks_sum
  19. toys_at_all = puzzles + talking_dolls + teddy_bears + minions + trucks
  20. #order = puzzles * puzzle_price + talking_dolls * talking_dolls_price \
  21. #        + teddy_bears * teddy_bear_price + minions * minions_price \
  22. #       + trucks * truck_price
  23. if toys_at_all >= 50:
  24.     order = order * 0.75
  25. rent = 0.10 * order
  26. total = order - rent
  27. if trip_price < total:
  28.     print(f"Yes! {total - trip_price:.2f} lv left.")
  29. else:
  30.     print(f"Not enough money! {trip_price - total:.2f} lv needed.")
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement