Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- biscuits = input().split(", ")
- command = input()
- while command != "Eat":
- current_command = command.split()
- if "Update-Any" in current_command:
- if current_command[1] in biscuits:
- for i in range(len(biscuits)):
- if biscuits[i] == current_command[1]:
- biscuits[i] = "Out of stock"
- elif "Remove" in current_command:
- if 0 <= int(current_command[2]) < len(biscuits):
- biscuits[int(current_command[2])] = current_command[1]
- elif "Update-Last" in current_command:
- biscuits[- 1] = current_command[1]
- elif "Rearrange" in current_command:
- if current_command[1] in biscuits:
- for i in range(len(biscuits)):
- if biscuits[i] == current_command[1]:
- biscuits.pop(i)
- biscuits.append(current_command[1])
- command = input()
- for i in range(len(biscuits)):
- if biscuits[i] is not "Out of stock":
- print(f"{biscuits[i]}", end=" ")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement