Menu

(Solved) : User Developing Simple Ciphering System Takes Message Input Produces Ciphered Message Outp Q37262535 . . .

User is developing a simple ciphering system that takes anymessage as input and produces a ciphered message as output. Indoing so, the user has to a write a PYTHON program that includestwo functions. The first is called make_dictionary(l1, l2) thattakes two equal-length lists of single-character strings. Itcreates and returns a dictionary using the elements of l1 as keysand the elements of l2 as values. The dictionary is then used by afunction called cipher(s, d). The parameter s is a string and d isthe dictionary created by make_dictionary. Function cipher(s, d)uses dictionary d to replace characters in s that are keys in dwith the corresponding key value. Characters in s that are notdictionary keys are left unchanged in the ciphered version of thestring s. The ciphered string is returned.

Make sure to add comments to your program. Your program shouldnot use any functions or methods we have not discussed inclass.

An example for the main program that prints pleise ciphec thisressige as output would look like the following:

list1 = [‘r’, ‘a’, ‘n’, ‘d’, ‘o’, ‘m’]list2 = [‘c’, ‘i’, ‘p’, ‘h’, ‘e’, ‘r’]cipherdict = make_dictionary(list1, list2)message = ‘please cipher this message’ciphered_message = cipher(message, cipherdict)print(ciphered_message)

Expert Answer


Answer to User is developing a simple ciphering system that takes any message as input and produces a ciphered message as output. …

OR