Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- budget = float(input())
- price_tot = 0
- product_counter = 0
- while price_tot <= budget:
- price_name = input()
- if price_name == "Stop":
- print(f"You bought {product_counter} products for {price_tot:.2f} leva.")
- break
- price_product = float(input())
- product_counter += 1
- if product_counter % 3 == 0:
- price_product -= price_product * 0.50
- price_tot += price_product
- else:
- print(f"You don't have enough money!\nYou need {(price_tot - budget):.2f} leva!")
Advertisement
Add Comment
Please, Sign In to add comment