Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- days = int(input())
- day_cash = 0
- for i in range(days):
- day_products = 0
- day_cash += 60
- while True:
- command = input()
- if command == "Day over":
- print(f"Money left from today: {day_cash:.2f}. You've bought {day_products} products.")
- break
- product_price = int(command)
- if product_price <= day_cash:
- day_cash -= product_price
- day_products += 1
- if day_cash == 0:
- print(f"Daily limit exceeded! You've bought {day_products} products.")
- break
Advertisement
Advertisement