Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- gifts_list = input().split()
- command_list = []
- while True:
- command = input()
- if command == "No Money":
- break
- elif "OutOfStock" in command:
- command_list = command.split()
- for i in range(len(gifts_list)):
- if command_list[1] in gifts_list:
- index = gifts_list.index(command_list[1])
- gifts_list[index] = "None"
- elif "Required" in command:
- command_list = command.split()
- if 0 <= int(command_list[2]) < len(gifts_list):
- gifts_list[int(command_list[2])] = command_list[1]
- elif "JustInCase" in command:
- command_list = command.split()
- gifts_list[len(gifts_list) - 1] = command_list[1]
- for i in range(len(gifts_list)):
- if "None" in gifts_list:
- gifts_list.remove("None")
- print(*gifts_list)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement