Question: document1:https://www.cse.msu.edu/~cse231/Labs/Lab10/document1.txt document2:https://www.cse.msu.edu/~cse231/Labs/Lab10/document2.txt lab10a:https://www.cse.msu.edu/~cse231/Labs/Lab10/lab10a.py lab10b:https://www.cse.msu.edu/~cse231/Labs/Lab10/lab10b.py Assignment overview This lab exercise provides practice with sets in Python. It has similarities to the previous lab on dictionaries, but

image text in transcribedimage text in transcribed

document1:https://www.cse.msu.edu/~cse231/Labs/Lab10/document1.txt

document2:https://www.cse.msu.edu/~cse231/Labs/Lab10/document2.txt

lab10a:https://www.cse.msu.edu/~cse231/Labs/Lab10/lab10a.py

lab10b:https://www.cse.msu.edu/~cse231/Labs/Lab10/lab10b.py

Assignment overview This lab exercise provides practice with sets in Python. It has similarities to the previous lab on dictionaries, but this time with sets You will work with a partner on this exercise during your lab session. Two people should work at one computer. Occasionally switch the person who is typing. Talk to each other about what you are doing and why so that both of you understand each step. Part A: Programming with Sets Consider the file named "lab10a.py". That file contains the skeleton of a Python program to do a simple analysis of two files: it will display the number of unique words which appear in the two files (the union of those two sets of words), as well as the number of unique words which are common to both files (the intersection of those two sets of words). Case does not matter: the words "pumpkin "Pumpkin" and "PUMPKIN" should be treated as the same word. Only unique words should be counted: if a word appears more than once in a file, it should only be counted once. Note: remember to remove punctuation from words, e.g. "it," should be "it" a. Replace the comments labeled "YOUR COMMENT" in function "build word set" with meaningful comments to describe the work being done in the next statement. Use more than one comment line, if necessary b. Revise function "compare files" to accomplish the work described in the comments. c. Test the revised program. There are two sample documents available: "document1.txt" (The Declaration of Independence) and "document2.txt" The Gettysburg Address)

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!