Advertisement
Guest User

Untitled

a guest
Feb 27th, 2020
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. days = int(input())
  2. day_limit = 0
  3.  
  4. for day in range(days):
  5. day_limit += 60
  6. product_counter = 0
  7. money_left_day = 0
  8. command = input()
  9. while command != "Day over":
  10. product_counter += 1
  11. price_product = float(command)
  12. if day_limit >= price_product:
  13. day_limit -= price_product
  14. if day_limit == 0:
  15. print(f"Daily limit exceeded! You've bought {product_counter} products.")
  16. break
  17. command = input()
  18. if command == "Day over":
  19. print(f"Money left from today: {day_limit}. You've bought {price_product} products.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement