Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- init_count_eggs = int(input())
- sold_eggs = 0
- total_count_eggs = init_count_eggs
- input_line = str(input())
- while input_line != "Close":
- command = input_line
- count_eggs = int(input())
- if command == "Buy":
- sold_eggs += count_eggs
- total_count_eggs -= count_eggs
- elif command == "Fill":
- total_count_eggs += count_eggs
- if command == "Close":
- print("Store is closed!")
- print(f"{sold_eggs} eggs sold.")
- break
- if count_eggs > total_count_eggs:
- print("Not enough eggs in store!")
- print(f"You can buy only {total_count_eggs}.")
- break
- input_line = str(input())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement