Home / Expert Answers / Computer Science / python-could-you-please-make-a-function-that-has-two-parameters-message-and-key-the-function-reads-pa586

(Solved): (python) could you please make a function that has two parameters message and key.the function reads ...



(python) could you please make a function that has two parameters message and key.
the function reads the message and changes the message with the code key.  when the letter is not in the key, it codes as ****. Thank you heaps!

\( \$ \) python 3 crypto.py
Welcome to crypto
Valid commands are: encrypt, decrypt and exit
Do you want to encrypt or decrypt
def decode_message(message, key):
1,
This function gets a message and a key list, and decrpyt the message by
replacing each
\( \$ \) python 3 crypto.py Welcome to crypto Valid commands are: encrypt, decrypt and exit Do you want to encrypt or decrypt? encrypt Enter the message to encrypt (only small letter english alphabets are allowed): hello world Ciphertext of the secret message is: \( 12681165126 \mathrm{c} 126 \mathrm{c} 126 \mathrm{feeee} 1377126 f 1372126 \mathrm{c} 1164 \) Do you want to encrypt or decrypt? encrypt Enter the message to encrypt (only small letter english alphabets are allowed): hi Ciphertext of the secret message is: 12681269 Do you want to encrypt or decrypt? encrypt Enter the message to encrypt (only small Letter english alphabets are allowed): ht4hi Ciphertext of the secret message is: \( 126812699 e q \) 12681269 Do you want to encrypt or decrypt? encrypt: Enter the message to encrypt (only small letter english alphabets are allowed): \#h Ciphertext of the secret message is: dece1268 Do you want to encrypt ar decrypt? exit Thank you for using our program. def decode_message(message, key): '1, This function gets a message and a key list, and decrpyt the message by replacing each code in the message with the alphabet from the key list. '1 \#ADD YOUR CODE HERE return decoded_msg


We have an Answer from Expert

View Expert Answer

Expert Answer


def main(): encryptedmsg="" nonkeys=[] key=[['a','1161'],['ab','1162'],['c','1163'],['d','1164'],['e','1165'],['f','1166'],['g','1167'],['h','1268'],[
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe