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