USING PYTHON  1. Write the PYTHON  Programs for the following exercises 2. For each program, you need to write: Comments for all the values, constants, and functions IPO Variables Pseudocode  File Analysis Write a program that reads the contents of two text files and compares them in the following ways: It should display a list of all the unique words contained in both files. It should display a list of the words that appear in both files. It should display a list of the words that appear in the first file but not the second. It should display a list of the words that appear in the second file but not the first. It should display a list of the words that appear in either the first or second file, but not both.

Question

USING PYTHON 

1. Write the PYTHON  Programs for the following exercises

2. For each program, you need to write:

    • Comments for all the values, constants, and functions
    • IPO
    • Variables
    • Pseudocode 

File Analysis
Write a program that reads the contents of two text files and compares them in the following
ways:
It should display a list of all the unique words contained in both files.
It should display a list of the words that appear in both files.
It should display a list of the words that appear in the first file but not the second.
It should display a list of the words that appear in the second file but not the first.
It should display a list of the words that appear in either the first or second file, but not
both.
Hint: Use set operations to perform these analyses.

Expert Answer

Want to see the step-by-step answer?

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.
Tagged in
Engineering
Computer Science

Python

Related Computer Science Q&A

Find answers to questions asked by students like you.

Q: Time CalculatorWrite a program that asks the user to enter a number of seconds.-There are 60 seconds...

A: The below given Java program will obey the following rubrics: Importing required package. Defining ...

Q: The benefits of aligning IS/IT with business strategy and why IS development is key to business stra...

A: Business–IT arrangement is a cycle where a business association utilizes data innovation to accompli...

Q: Create a WBS for a project to create a job portal for students with an embedded exam set by employer...

A: The Work Breakdown Structure (WBS) includes the entire scope of a project and shows it diagrammatica...

Q: I am trying to create a application that generates a random number in the range of 1 through 100 and...

A: Actually, the code has given below:

Q: Problem_#06] Express the following numbers in 8 bit l's complement notation. (а) —34 (b) +57 (с) —99...

A: NOTE: -Hi, Since multiple questions are there, only the first problem is solved below. 6(a) -34 STEP...

Q: The n-th Fibonacci number Fn is defined recursively as Fn=Fn−1+Fn−2 where F0=0 and F1=1 . For instan...

A:   fibonacci: push {r1-r3} mov r1, #0 mov r2, #1 fibloop: mov r3...

Q: Question 2: Write a C Program A bank wants a program that determines the yearly interest earned on a...

A: #include<stdio.h> int main(){    //declare the variables to store amount, interest, term    fl...

Q: 19) Define an appropriate language and formalize "There is a student who is loved by every other stu...

A:  ∃x(Student(x∧∀y.Studenty∧x=y→Loves(y,x)) it says some students are loved by every students ∃xStuden...

Q: Show how to define a view tot credits (year, num credits), giving the total numberof credits taken i...

A: SQL Query

Q: Create a class Queue that implements the functionality of a queue providing all the requiredoperatio...

A: Programming approach Here, a class Queue is created with the following members: Integer  "front", "...

Q: Please help me with this problem using c++. Also how could you create the program without having to ...

A: Actually, the code has given below:

Q: Python code

A: Click to see the answer

Q: python.

A: In this question, first we take an input from user that from which text file want to make combinatio...

Q: Construct an automaton for i) Reverse of L

A: Click to see the answer

Q: A two-dimensional random walk simulates the behavior of a particle moving in a grid of points. At ea...

A: Actually, the code has given below:

Q: What are the 2 categories of errors when debugging code? How can the try-except statements handle er...

A: Two categories of errors while debugging code in python: Syntax error The errors generated when the ...

Q: List and describe the four memory allocation algorithms covered in Operating Systems. Which two of t...

A: The following are four common memory management techniques in the operating system. Single Contiguou...

Q: what is the process model and the use case diagram of the given UML diagram? (a samll size software ...

A: The process model for the above UML diagram is called as pet shop process model. Process Model is de...

Q: Payor: You are working for an insurance company and you need a database to help track your quality m...

A: Business Rule : A business rule characterizes or compels some part of business and consistently sets...

Q: Discuss intents and their uses in Android development. Make sure you mention the two types of intent...

A: Intents and their uses in Android development Intent is used for performing an action. It is mainly...

Q: Assume that the population of Mexico is 128 million and that the population increases 1.01 percent a...

A: Since programming language is not mentioned in the question, we will answer this question in the Jav...

Q: Please solve with explanation

A:  The product code  which is NOT valid is option (a)  i.e. ,  EAN barcode: 8562154-87885-1  Because h...

Q: Which of the following is NOT a reserved word in Java?   Group of answer choices for loop do ...

A: Reserved words: Words that have a pre-defined meaning. Reserved words cannot be used as names of var...

Q: Python - Text Processing Write a function copy(x, y) that can copy a file x into another file y. Use...

A: PROGRAM: #Defining the copy(x,y) def copy(x, y):     #Try block to throw file exception   try:      ...

Q: I'm trying to complete the function for my HTML file

A: Objective: A function domLaoded needs to be written in HTML to convert a given temperature from eith...

Q: #include <stdio.h>#include <stdint.h> char sz_1[] = "Upper/LOWER.";char sz_2[] = "mIXeD ...

A: ASSEMBLY LANGUAGE: Assembly language is basically the low level language which is used for various ...

Q: The machine language: Convert this code to decimal, hexadecimal, and binary. O×4CB23 Loop: beq $t1, ...

A: Binary Code:                                                                                        ...

Q: OBJECTIVE:Design a lexical analyzer for given language and the lexical analyzer should ignore redund...

A: Objective: This program receives an input file and performs a lexical analysis. It reads the input E...

Q: Python program In another program, use the function you wrote in question 5 to print the prime numbe...

A: EXPLANATION - Firstly we will need  a for loop for iterating a loop between from number 1 to 100. Wi...

Q: Discuss the reasons that one might choose SystemC over Verilog.

A: Below are the reasons that one might use system C over Verilog.

Q: Question 5.  Develop a decision tree for the given data set.   Age Job House Credit Loan Approved ...

A: Click to see the answer

Q: Write code that prompts the user to enter a number in the range of 1 through 100 and validates the i...

A: foo = int( input( "Enter a number between 1 and 100 inclusive: " ) )if( ( foo > 100 ) or ( foo &l...

Q: What are some job positions seeking the Network+ or CCNA certification. What are the job responsibil...

A: Some job positions seeking the Network+ :- This certification demonstrates that you have a basic und...

Q: Write a postcondition, event-controlled loop (i.e., a while loop), using a flag variable, that print...

A: PROGRAM STRUCTURE: Initialize the flag variable. Declare the loop variable to print the series. Sta...

Q: • Using for loop #The given word str = "Complication" #An intermediate variable to store and print t...

A: Click to see the answer

Q: Might there be a way to directly access commonly used operators, such as the arithmetic operators or...

A: Operator Overloading : The thing that matters is that the contentions for this capacity don't show u...

Q: Describe the following Java code.  Give screenshots of the image it produces public class main{ pub...

A: There were some errors in the code, because of which this code was not working. The code has been fi...

Q: Plot the function f(x) = x4 − 3x3 + 10x2 − x − 2 for −6 ≤ x ≤ 6.Draw the function as a solid black 2...

A: Actually, the answer has given below:

Q: Create an object called Circle. Declare the following integer variables for the object Circle, radiu...

A: class Circle{    int radius, diameter;    double pi;    Circle(int r, int d, double p){        radiu...

Q: Given the following three word sequences (i.e., the corpus)– very good tennis player in US open– ten...

A: Terminology : Sentence : unit of written language.Word Form : The inflected form that appears in the...

Q: Discuss the difference between traditional software models delivered by ApplicationService Providers...

A: SaaS is a term that means software as a service. It is a business model which implies that you don’t...

Q: Hi everyone, I need help with automata, please

A: Click to see the answer

Q: Create the following queries for the “books” database. For each query make sure to only include thos...

A: SELECT COUNT(TITLE_ID) AS "# of long books" FROM TITLES WHERE TITLES.PAGES>=450 GROUP BY TYPE;

Q: Computer Science Question

A: #include<iostream> using namespace std; //calculating rectangular section MIfloat rectangleMom...

Q: a) create a dictionary, rank = {1:"Freshman", 2:"Sophmore", 3:"Junior", 4:"Senior" }b) request a use...

A: rank = {1: "Freshman", 2: "Sophmore", 3: "Junior", 4: "Senior"} n = int(input("Enter number of years...

Q: Consider the following C++ code: int* length = new int; int* height = new int; *height = 12; *le...

A: Step 1:-   Introduction:-   The pointer is a variable that stores the address of another variable. F...

Q: Program to be written in C: Write a program that reads a list of integers, and outputs those integer...

A: #include <stdio.h>#include <stdlib.h> int main() { int a[20]; int n; int i;  scanf("%d",...