Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- items = input().split(', ')
- while True:
- command = input()
- if command == 'Craft!':
- print(f'{", ".join(items)}')
- break
- tokens = command.split(' - ')
- if tokens[0] == 'Collect':
- item = tokens[1]
- if item not in items:
- items.append(item)
- elif tokens[0] == 'Drop':
- item = tokens[1]
- if item in items:
- items.remove(item)
- elif tokens[0] == 'Combine Items':
- args = tokens[1].split(':')
- old_item = args[0]
- new_item = args[1]
- if old_item in items:
- index = items.index(old_item) + 1
- items.insert(index, new_item)
- elif tokens[0] == 'Renew':
- item = tokens[1]
- if item in items:
- current_item = item
- items.remove(item)
- items.append(current_item)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement