Read and sort words Instructions Create a Python program that does the following: - Opens the
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 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.
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill