You are to write a program that deals with the words common to two or more files whose names are supplied on the command line. All the code will be in the file common_words.py. A command to execute the program would look like this:

python common_words.py filename1 filename2

Of course, "python" may need to be "python3" or "python3.6" depending on your python 3 version.

For the purpose of this assignment, the words of a string are those separated by whitespace.

So your program should create a list of words for each file; then determine the list of words that occur in all the files.

You will then print that list. Your output should look like this:

COMMON WORDS
word1 word2 …

followed by a blank line. Then, for each filename, you should list the other filenames for which the common words appear in the same order. If a filename appears in a prior list, skip it.

Assuming the filename arguments were filename1, filename2, filename3, filename4, filename5, filename6, the following would be a possible output for this part.

filename1: filename3 filename6
filename2: filename5
filename4:

You should submit a file named, of course, common_words.py

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.