Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- budget = float(input())
- counter = 0
- given_money = 0
- price = 0
- while True:
- product_name = input()
- if product_name == "Stop":
- print(f"You bought {counter} products for {given_money:.2f} leva.")
- break
- price = float(input())
- if price > budget:
- print(f"You don't have enough money!")
- print(f"You need {price - budget:.2f} leva!")
- break
- counter += 1
- if counter // 3 == 1:
- price = price * 0.50
- given_money += price
- budget -= price
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement