Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- gifts = input().split()
- command = input()
- while not command == "No Money":
- splited_command = command.split()
- if splited_command[0] == "OutOfStock":
- gifts = [item if item != splited_command[1] else "None" for item in gifts]
- elif splited_command[0] == "Required":
- value = splited_command[1]
- index = int(splited_command[2])
- if 0 <= index < len(gifts):
- gifts[index] = value
- elif splited_command[0] == "JustInCase":
- value = splited_command[1]
- gifts[-1] = value
- command = input()
- gifts = [item for item in gifts if not item == "None"]
- print(" ".join(gifts))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement