Question: Need help with this problem. We are using Anaconda-Python(Spyder 3.5 or above), so please use python language. The professor says we could solve this in

Need help with this problem. We are using Anaconda-Python(Spyder 3.5 or above), so please use python language. The professor says we could solve this in as few lines as 6. Also type link into google chrome browser to get the (long) poem Othello. Use set operations if needed. Thank you so much
 Need help with this problem. We are using Anaconda-Python(Spyder 3.5 or

Write a program that shall eliminate duplicate words from a text file. The program shall: 1. Ask the user to enter a name of an existing text file; if the file does not exist or cannot be opened for any other reason, the program shall print an error message and terminate. Read the content of the file and eliminate all duplicate words, except for the first occurrence. For the purpose of this exercise, a word is any sequence of characters that does not contain any spaces, and two words are duplicates if they differ at most in the character case (e.g., "Mary" and "mArY are duplicates) Write the text without duplicates into the file nodups-XXX, where XXX is the name of the 2. 3. e program shall print an error message and terminate. Test program by removing duplicates from Othello: 4. http://www.gutenberg.org/cache/epub/2267/pg2267-images.html

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!