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