Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help writing two seperate PYTHON (python only) codes. I will provide a skeleton code for both part A and B. The skeletons should be

Need help writing two seperate PYTHON (python only) codes.

I will provide a skeleton code for both part A and B. The skeletons should be followed, as well as, the directions.

Part A Skeleton Code (Follow this when writing code)

image text in transcribed

Part A Directions

image text in transcribed

Part B Skeleton Code

image text in transcribed

Follow that skeleton above please.

Here is Part B directions. Please follow these!

image text in transcribed

Thank you for the help!

D Python: Classe Intro. x MOh Mail noonanroe msu x P CSE 23 233 unread x f Lab Exercises C Secure https:// www.cse msu.edu Apps For quick access, place your bookmarks here on the bookmarks bar. mport bookmarks now. import string def build word set. input file): word set. set for line in input file: YOUR COMMENT word ist line strip split YOUR COMMENT word lst Lw.lower strip (string punctuation for w in word lst for word in word 1st if word YOUR COMMENT word set.add word) return word set def compare files filel file2 Build two sets: all of the unique words in filel all of the unique words in file2 Display the total number of unique words between the two files If a word appears in both files it should only be counted once. print Total unique words unique word count Display the number of unique words which appear in both files A word should only be counted if it is present in files. print Unique words that appear in both files unique word in both count f1 open document 1.txt" f 2 open document 2.txt compare files fl f2) fl .close f2 .close x f https: www.cse.msu e x R https:/www.cse.msi ex f Microsoft Word lab x a Bobby

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Step: 3

blur-text-image

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

DB2 11 The Database For Big Data And Analytics

Authors: Cristian Molaro, Surekha Parekh, Terry Purcell, Julian Stuhler

1st Edition

1583473858, 978-1583473856

More Books

Students also viewed these Databases questions