Question: here is the function. Python. Help, please def decrypt (word list): ''' Test >>> decrypt (test_codes) When will the sun come back >>> decrypt (encrypt('2b

 here is the function. Python. Help, please def decrypt (word list):''' Test >>> decrypt (test_codes) When will the sun come back >>>

decrypt (encrypt('2b or not 2b')) 2b or not 2b pass Exercise 3

here is the function.

Python. Help, please

def decrypt (word list): ''' Test >>> decrypt (test_codes) When will the sun come back >>> decrypt (encrypt('2b or not 2b')) 2b or not 2b pass Exercise 3 del decrypt(word_list): Inputs: a 2 dimensional list Results: prints a sentence or phrase Details: This function takes a sentence that had been encrypted with the exercise 2 function and converts in back into a sentence or phrase. Remember that the chri) function takes a parameter of a character code and returns the actual character: chr(116) When printing, be sure to add a space after each converted word. The template file contains one pre-encrypted phrase (test_codes) for you to test with but you should also create your own test cases using the encrypt function you write for exercise 2 Example output: >>> decrypt (test_codes) When will the sun come back >>> decrypt (encrypt('2b or not 2')) 2b or not 2b def encrypt (phrase): "'' Test >>> encrypt ('When will the sun come back') [[87, 104, 101, 110], [119, 105, 108, 108], [116, 104, 101], [115, 117, 110], [99, 111, 109, 101], [98, 97, 99, 107]] >>> encrypt('Is there room for 1 more?') [[73, 115], [116, 104, 101, 114, 101], [114, 111, 111, 109], [102, 111, 114], [49], [109, 111, 114, 101, 63]] >>> encrypt('Number test: 73, 115, 104, 22') [[78, 117, 109, 98, 101, 114], [116, 101, 115, 116, 58], [55, 51, 44], [49, 49, 53, 44], [49, 48, 52, 44], [50, 50]] def encrypt(s): mat=[] st=s.split('') #print (len (st)) for i in range (len (st)): word=[ord (char) for char in st[i]] #print (word) mat.append(word) print (mat) encrypt('too many cats') encrypt ('When will the sun come back') test codes = [ [87, 104, 101, 110), [119, 105, 108, 108], [116, 104, 101], [115, 117, 110), [99, 111, 109, 101], [98, 97, 99, 107]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!