Question: 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.

In python, rework exercise 30 with the word union in the ninth

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

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!