Professor Moriarty has devised an evil plot encrypted using the Caesar cipher. To make matters worse, each word in the plan is encoded with a unique offset. Thankfully, Mary managed to get hold of the encoded text and the offset for each word. You also have a function Moriarty used to encrypt each word:
def decode_Caesar_cipher(s, n):
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',.?!"
s = s.strip()
text = ''
for c in s:
text += alpha[(alpha.index(c) + n) % len(alpha)]
print(text)Now, it's your chance to demonstrate your prowess against malevolent forces. Write a program that accepts "--word" and "--offset" as command-line arguments. The program should decode the given word with the specified offset and print the result. Keep in mind, you already have the crucial function for decoding the message. Given a word and an offset, simply use the negative of the offset to reverse the encryption process.
Tip:
This task might be demanding, so let's simplify it:
A significant part of the code is already prepared for you. Use the existing code and add a few lines to retrieve and parse command-line arguments,
Apply the negative of the offset to decode the string,
Print the decoded text without quotation marks, just as the given function does
Remember, the program should not take any input; only parse command-line arguments as expected.