Question: Read and sort words Instructions Create a Python program that does the following: - Opens the file attached to this assignment: https://www.dropbox.com/scl/fi/kcgvam3ljbv2at0ci110k/LoremIpsum.txt?rlkey=3fb0i23p74a9ci2dd55fqf9t4&dl=0 - Reads

Read and sort words

Instructions 

 

Create a Python program that does the following:

- Opens the file attached to this assignment: https://www.dropbox.com/scl/fi/kcgvam3ljbv2at0ci110k/LoremIpsum.txt?rlkey=3fb0i23p74a9ci2dd55fqf9t4&dl=0

- Reads the contents of the file into a String variable.

- Using the String.split() function, split the contents of the String variable into individual words, as entries in a List.  So each item of the new List will be a word from the file.

- Create another separate list that contains only the unique words with no duplicates.

- OUTPUT: the list from the lest step above, sorted alphabetically. HINT: use the String.sort() function.

Additional info on String functions (goes to W3schools website) https://www.w3schools.com/python/python_ref_list.asp

What to submit: Your python (.py) code file.



Step by Step Solution

3.31 Rating (175 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Below is the Python code Import necessary libraries import urllibrequest Define the URL of the file ... View full answer

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 Programming Questions!