Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- message = input()
- while True:
- command = input()
- if command == "Decode":
- break
- tokens = command.split('|')
- command = tokens[0]
- if command == "Move":
- index = int(tokens[1])
- message = message[index:] + message[: index]
- elif command == "Insert":
- index = int(tokens[1])
- value = tokens[2]
- message = message[:index] + value + message[index:]
- elif command == "ChangeAll":
- old = tokens[1]
- new = tokens[2]
- message = message.replace(old, new)
- print(f"The decrypted message is: {message}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement