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