Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- days = int(input())
- money_left = 0
- found = False
- for i in range(days):
- balance = 60 + money_left
- products = 0
- price = input()
- while price != "Day over":
- if int(price) <= balance:
- balance -= int(price)
- products += 1
- money_left = balance
- if balance == 0:
- print(f"Daily limit exceeded! You've bought {products} products.")
- break
- price = input()
- else:
- money_left = balance
- print(f"Money left from today: {balance:.2f}. You've bought {products} products.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement