Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

Below is the Python code Import necessary libraries import urllibrequest Define the URL of the file ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions