Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- collected_items = input().split(", ")
- input_line = input()
- while input_line != "Craft!":
- command, item = input_line.split(" - ")
- if command == "Collect":
- if item not in collected_items:
- collected_items.append(item)
- elif command == "Drop":
- if item in collected_items:
- collected_items.remove(item)
- elif command == "Combine Items":
- old_item, new_item = item.split(':')
- if old_item in collected_items:
- collected_items.insert(collected_items.index(old_item) + 1, new_item)
- else:
- if item in collected_items:
- collected_items.append(collected_items.pop(collected_items.index(item)))
- input_line = input()
- print(", ".join(collected_items))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement