Advertisement
bl00dt3ars

Untitled

Jul 10th, 2021
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.69 KB | None | 0 0
  1. message = []
  2. line = input()
  3.  
  4. while not line == "end":
  5.     command = line.split()
  6.     if command[0] == "Chat":
  7.         message.append(command[1])
  8.     elif command[0] == "Delete":
  9.         if command[1] in message:
  10.             message.remove(command[1])
  11.     elif command[0] == "Edit":
  12.         if command[1] in message:
  13.             message[message.index(command[1])] = command[2]
  14.     elif command[0] == "Pin":
  15.         if command[1] in message:
  16.             message.remove(command[1])
  17.             message.append(command[1])
  18.     elif command[0] == "Spam":
  19.         for el in range(1, len(command)):
  20.             message.append(command[el])
  21.     line = input()
  22.  
  23. [print(el) for el in message]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement