Advertisement
George_Ivanov05

11

Jun 23rd, 2021
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1. items = input().split(", ")
  2. command = input().split(" - ")
  3.  
  4. while command[0] != "Craft!":
  5.  
  6.     if command[0] == "Collect":
  7.         if command[1] not in items:
  8.             items.append(command[1])
  9.  
  10.     elif command[0] == "Drop":
  11.         if command[1] in items:
  12.             items.remove(command[1])
  13.     elif command[0] == "Combine Items":
  14.         element = command[1].split(":")
  15.         if element[0] in items:
  16.             items.insert(items.index(element[0]) + 1, element[1])
  17.         else:
  18.             continue
  19.     elif command[0] == "Renew":
  20.         if command[1] in items:
  21.             items.remove(command[1])
  22.             items.append(command[1])
  23.     command = input().split(" - ")
  24. print(", ".join(items))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement