Advertisement
fumanbest

Inventory

Mar 14th, 2020
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.85 KB | None | 0 0
  1. journal = input().split(', ')
  2.  
  3. command_input = input()
  4. while command_input != 'Craft!':
  5.     args = command_input.split(" - ")
  6.     command = args[0]
  7.     if command == 'Collect':
  8.         item = args[1]
  9.         if not item in journal:
  10.             journal.append(item)
  11.     if command == 'Drop':
  12.         item = args[1]
  13.         if item in journal:
  14.             journal.remove(item)
  15.     if command == 'Combine Items':
  16.         item = args[1].split(':')
  17.         text = item[0]
  18.         text1 = item[1]
  19.         if text in journal:
  20.             place = journal.index(text)
  21.             journal.insert(place + 1, text1)
  22.     if command == 'Renew':
  23.         item = args[1]
  24.         if item in journal:
  25.             place = journal.index(item)
  26.             journal.pop(place)
  27.             journal.append(item)
  28.  
  29.     command_input = input()
  30.  
  31. print(", ".join(journal))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement