viligen

inventory

Oct 18th, 2021
717
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. input_items = input().split(", ")
  2.  
  3. while True:
  4.     command = input().split(" - ")
  5.     if "Craft!" in command:
  6.         break
  7.     item = command[1]
  8.     if "Collect" in command and item not in input_items:
  9.         input_items.append(item)
  10.     elif "Drop" in command and item in input_items:
  11.         input_items.remove(item)
  12.     elif "Combine Items" in command:
  13.         item_split = item.split(":")
  14.         if item_split[0] in input_items:
  15.             index_old = input_items.index(item_split[0])
  16.             input_items.insert(index_old + 1, item_split[1])
  17.     elif "Renew" in command and item in input_items:
  18.         input_items.remove(item)
  19.         input_items.append(item)
  20. print(", ".join([s for s in input_items]))
  21.  
RAW Paste Data