Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- gifts = input().split(' ')
- command = input()
- while command != 'No Money':
- commands = command.split(' ')
- if commands[0] == 'OutOfStock':
- gifts = list(map(lambda x: x if x != commands[1] else 'None', gifts))
- elif commands[0] == 'Required':
- if 0 <= int(commands[2]) < len(gifts):
- gifts[int(commands[2])] = commands[1]
- elif commands[0] == 'JustInCase':
- gifts[len(gifts) - 1] = commands[1]
- command = input()
- gifts = list(filter(lambda a: a != 'None', gifts))
- print(' '.join(gifts))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement