1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
SOVA2 [1]
3 years ago
10

Design the program that reads two files and compares their contents. The program calls a method that reads the file one line at

a time. If the lines are the same the program skips the line. If the lines are different then the program prints the line number followed by the different lines from each file.
Computers and Technology
1 answer:
Advocard [28]3 years ago
5 0

Answer:

file1 = []

file2 = []

fileone = "lyric1.txt"

filetwo = "lyric2.txt"

def linereader( myfile, mylist):

   for line in open(myfile, "r") as file:

       line_read = readlines( line)

       mylist.append( line_read)

   file.close()

linereader( fileone, file1)

linereader( filetwo, file2)

# Assuming both files have same number of lines.

for index, item in enumerate(zip(file1, file2)):

   if item[0] != item[1]:

       print( index + 1, item)

Explanation:

The python code compares two files and returns the number and the lines from both files that do not match. The source code opens the files lyric1.txt and lyric2.txt reading each lines to different lists which are iterated to compare its items returning the number of the line and the unequal lines.

You might be interested in
Which of the following functions of Information Security Management seeks to dictate certain behavior within the organization th
Dmitriy789 [7]

Answer:

The correct answer to the following question will be Option B (Policy).

Explanation:

  • The Policy is a systematic set of rules for driving policies and obtaining rational results. It is a declaration of intent and is applied as a process or protocol.
  • Policies are usually implemented by the governing body throughout the corporation.
  • It was the feature of Information assurance management, which sought to dictate those activities throughout the organization via a collection of institutional requirements.

Therefore, Option B is the right answer.

7 0
3 years ago
#It helps in the proper function ing of computer hardware.
zalisa [80]
4- system software
2- application software
4- software package
1- assembler
2- antivirus program
3 0
3 years ago
You have received a "no boot device found" notification upon booting your system. what does this mean, and what can you do to tr
zloy xaker [14]
Basically no boot device could be 1 of three things listed below.

1. You have connected an incorrect external device and the system responds to boot from this however no operating system is available. Hence the error. What to do : You have disconnect, reset and select the correct bootable device.
2. You have a faulty hardware specifically your bootable harddisk, corrupted or malfunctioning. You have to reformat and correct the bios installed on the disk.
3. You have not selected correct bootable device. - Select the correct harddisk, if you have partition, be sure to select the one with the Operating system is installed to.
8 0
3 years ago
What is input process<br>​
riadik2000 [5.3K]

Answer:

describing the structure of an information processing program or another process. Many introductory programming and systems analysis texts introduce this as the most basic structure for describing a process.

Explanation:

  • A requirement from the environment (input)
  • A computation based on the requirement (process)
  • A provision for the environment (output)

Example: A small engineering firm believes there are problems with its hiring process. Several of the junior engineers that have been hired remained at the firm for less than one year. This is a considerable cost to the firm, since recruiting and training new engineers is time consuming and expensive. The human resources manager decides to put together a group of people with extensive experience hiring new engineers. One of their first tasks is to produce an input-output model of the hiring process. They generate the following.

4 0
3 years ago
I gift points!!!!!! Come on!!!!!!!
pogonyaev

Answer:yesss

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • It creates an SQL statement to find the project that has the most employees from the same department. If more than one project m
    11·1 answer
  • The _______ has shortcuts to commonly used commands
    8·2 answers
  • How has technology fragmented the audience for sports and entertainment<br> commodities?
    10·1 answer
  • To use the program service routines, the user's program makes requests to the operating system through the
    10·1 answer
  • Concerning Structured Cabling, select the statement that is true, or select, "All statements are false."
    5·1 answer
  • In a five-choice multiple-choice test, which letter is most often the correct
    10·2 answers
  • The person responsible for setting goals and schedules, monitoring work, motivating the team, and reporting progress to managers
    7·1 answer
  • 9. Which is an example of a function?<br>(1 Point)<br>=A1 +A2<br>=SUM(A1:A3)<br>=ADD(A1:A3)​
    14·2 answers
  • 11) A single inheritance model means: * A) A class can only have one parent class (superclass) B) A class can only have one chil
    7·1 answer
  • In a networking context, "architecture" refers to
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!