Question: 1 , 2 , 3 , 4 , 5 Not yet TESTCASES tests ImportError: Failed to import test module: tests Traceback ( most recent call
Not yet
TESTCASES
tests
ImportError: Failed to import test module: tests
Traceback most recent call last:
File usrlibpythonunittestloaderpy line in findtestpath
module self.getmodulefromnamename
File usrlibpythonunittestloaderpy line in getmodulefromname
name
File tmptestspy line in The UDP Word Jumble! In your job as a network engineer you've been asked to write a program that unscrambles a message sent via UDP and puts things in the correct order. To do this you need to complete the function unscramble which takes a str parameter specifying the filename of the file to read the data from, and returns a str which is the unscrambled message. The file will contain a series of lines where the first thing on each line is a two digit number, which is the "packet number" ie the order the lines were sent in followed by a colon, a space and then the string giving the part of the message in that "packet" just to be clear, there's no actual packets and no network programming to do The function should then put the message back together in the order the lines were sent in ie sort by the packet number and return the message as a single string without the packet numbers, the colon and space after the colon For example, the following input data: : message. : This is : a Should result in the output: This is a message. NOTE: My output should be correct. But i am unsure why i am failing those last two test cases Description The UDP Word Jumble! In your job as a network engineer you've been asked to write a program that unscrambles a message sent via UDP and puts things in the correct order. To do this you need to complete the function unscramble which takes a str parameter specifying the filename of the file to read the data from, and returns a str which is the unscrambled message. The file will contain a series of lines where the first thing on each line is a two digit number, which is the "packet number" ie the order the lines were sent in followed by a colon, a space and then the string giving the part of the message in that "packet" just to be clear, there's no actual packets and no network programming to do The function should then put the message back together in the order the lines were sent in ie sort by the packet number and return the message as a single string without the packet numbers, the colon and space after the colonDescription lines were sent in followed by a colon, a space and then the string giving the part of the message in that "packet" just to be clear, there's no actual packets and no network programming to do The function should then put the message back together in the order the lines were sent in ie sort by the packet number and return the message as a single string without the packet numbers, the colon and space after the colon For example, the following input data: : message. : This is : a Should result in the output: Note: to get a substring of a string in Python, you can take a slice: Run x "Test string" sx: #Play around with the print s ex ; # The second numberetxt unscramble.py Thomeunscramblepy Spaces: Auto All changes saved Run MarkDescription Already ordered. A mess. 'Hopefully you can unscramble this chaos. 'Hopefully youcanunscramble this chaos. Hopefully you can unscramble this chaos. This is a message. Hopefully youcanunscramble this chaos. : The output should be 'Hopefully you can unscramble this chaos. but was 'Hopefully youcanunscramble this chaos. Program exited with code
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
