Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- chat = []
- while True:
- command = input().split()
- if command[0] == "end":
- break
- elif "Chat" == command[0]:
- chat.append(command[1])
- elif command[0] == "Delete" and command[1] in chat:
- chat.remove(command[1])
- elif command[0] == "Edit" and command[1] in chat:
- index_msg = chat.index(command[1])
- chat[index_msg] = command[2]
- elif command[0] == "Pin" and command[1] in chat:
- chat.remove(command[1])
- chat.append(command[1])
- elif command[0] == "Spam":
- messages = command[1:]
- chat = chat + messages
- print("\n".join(chat))
Advertisement
Add Comment
Please, Sign In to add comment