Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In python, rework exercise 30 with the word union in the ninth line changed to intersection. Please also put screenshot of your code. In Exercises

In python, rework exercise 30 with the word union in the ninth line changed to intersection. Please also put screenshot of your code.

image text in transcribed

In Exercises 30 through 32, describe the new file created by the code. Assume the file Ny Times. txt contains the names of subscribers to the New York Times and the file wsJ.txt contains the names of the subscribers to the Wall Street Journal. 30 infile open ("NYTimes. r') .txt", times List Cline. rstrip for line in infile] in file close timesset. sets (timesList) infile open ("WSJ.txt. 'r') wsjList. Cline. rstrip for line in infile] in file close wsjset. sets (wsjList) combinationset. timesSet.union (wsjset) combinationList list (combinationset) combinationstring ('In') oin (combination List outfile open ("NewFile.txt", 'w') outfile write (combinations tring) outfile close

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

More Books

Students also viewed these Databases questions