Homework IX-a Write a program that opens a text file, whose name you enter at the keyboard You will be using the file text.txt to test your program. Print out all of the individual, unique words contained in the file, in alphabetical order Print out the number of unique words appearing in text.txt. Call your program: YourName-HwrklXa.py Make sure that your name appears as a comment at the beginning of the program as well as on the output display showing the unique words Homework IX-b Write a program that reads the contents of two text files and compares them in the following ways It should display a list of all the unique words contained in the union of both files. It should display a list of the words that only appear in both files. It should display a list of the words that appear in the first file but not the second It should display a list of the words that appear in the second file but not the first. It should display a list of the words that appear in either the first or second file but not both . Take particular care to be sure that words that are spelled the same, except for case are not considered two different words (e.g. "The" and "the" are the same word) . Take particular care to be sure that all punctuation is stripped away so that words like, "quick" and "quick," are not considered two different words. The two files you will compare are: first_file.txt and second_file.txt Call your program: YourName-HwrkiXb.py Again, make sure that you name appears as a comment at the beginning of the program as wel as on the output display showing the results. Homework IX-a Write a program that opens a text file, whose name you enter at the keyboard You will be using the file text.txt to test your program. Print out all of the individual, unique words contained in the file, in alphabetical order Print out the number of unique words appearing in text.txt. Call your program: YourName-HwrklXa.py Make sure that your name appears as a comment at the beginning of the program as well as on the output display showing the unique words Homework IX-b Write a program that reads the contents of two text files and compares them in the following ways It should display a list of all the unique words contained in the union of both files. It should display a list of the words that only appear in both files. It should display a list of the words that appear in the first file but not the second It should display a list of the words that appear in the second file but not the first. It should display a list of the words that appear in either the first or second file but not both . Take particular care to be sure that words that are spelled the same, except for case are not considered two different words (e.g. "The" and "the" are the same word) . Take particular care to be sure that all punctuation is stripped away so that words like, "quick" and "quick," are not considered two different words. The two files you will compare are: first_file.txt and second_file.txt Call your program: YourName-HwrkiXb.py Again, make sure that you name appears as a comment at the beginning of the program as wel as on the output display showing the results.
-
Engineering 2022-05-15 19:04:59