Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- available_eggs = int(input())
- sold_eggs = 0
- command = input()
- while command != "Close":
- eggs = int(input())
- if command == "Buy":
- if available_eggs - eggs < 0:
- break
- available_eggs -= eggs
- sold_eggs += eggs
- elif command == "Fill":
- available_eggs += 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 {available_eggs}.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement