Question: Please answer in Python. Problem 3 A function stringList which converts a string to a list of strings is given below. Include this function in

Please answer in Python.

Please answer in Python. Problem 3 A function stringList which converts a

Problem 3 A function stringList which converts a string to a list of strings is given below. Include this function in your code file. def atringtist { str 1}: return str1. split \{\} stringList ("Hello this is test run") ['Hello', 'this', 'is', 'test', 'run'] Your job is to encode a given message. Write a recursive function encodeM which takes a list of strings and converts it to an encoded message. Note: you can make use of the encode function, encode works on a single string and encodeM encodes all strings in the given list of strings. encodeM(['This', 'is', 'a', 'test', 'run']) ['Ymnx', 'nx', 'f', 'yjxy', 'wzs'] Write a recursive function decodeM, which uses a function decode to decode the list of strings. decodeM (['Ymnx', 'nx', 'f', 'Yjxy', 'wzs']) ['This', 'is', 'a', 'test', 'run'] The function main given below should be included in your program and once remove Pun, encode, enodeM, decode and decodeM have been written this function will give the following output. main ("COMP1126!! is, a lot of:;. fun?") Given atring COMP1126!! is a lot of:;. fun? Punctuation removed COMP1126 is a lot of fun List Encoded ['HTRU667;', 'nx', ' f ', 'qty', 'tk', 'kzs'] List Decoded ['COMP1126', 'is', 'a', 'lot', 'of', 'fun'I Encoded Message HTRU667; nx f qty tk kzs def main (s): slst=removePun (s) elist = encodeM (stringIist (slst) ) dist = decodeM (eLiat) print "Given string => ", ") print ("Punctuation removed =>n, Elst) print("Iist Encoded =>", eList] print "List Decoded => ", dList? print ("Encoded Message =>", ', join(eLiat))

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!