Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- gifts = input()
- gifts_list = gifts.split(" ")
- while True:
- command = input().split(" ")
- if command[0] == "No" and command[1] == "Money":
- break
- if command[0] == "OutOfStock":
- for idx, ele in enumerate(gifts_list):
- if ele == command[1]:
- gifts_list[idx] = "None"
- # gifts_list.remove(str(command[1]))
- elif command[0] == "Required":
- gifts_list[2], command[1] = command[1], gifts_list[2]
- elif command[0] == "JustInCase":
- gifts_list[-1], command[1] = command[1], gifts_list[-1]
- for idx, ele in enumerate(gifts_list):
- if ele == "None":
- gifts_list.remove(ele)
- print(" ".join(gifts_list))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement