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
A lead views a specific page on your website, say, your case study page. You then send targeted follow-up content like one of yo
IRINA_888 [86]

Answer:

Behavioral Email                                

Explanation:

A behavioral email is an automated email which is sent to recipients on the basis of their behavior. These emails are sent after a user communicates with a business on social media, the company’s website, email, and other communication medium. Behavioral emails help to grow customer involvement and sales. Behavioral email can also be used as a marketing strategy, used by marketers to gather data about an email subscriber in order to send targeted content to that subscriber on the basis of his behavior or actions. When the marketer sends an email to the customer, it is appropriate for that customer, based on the data gathered and their current monitored behavior. Behavioral email helps to understand costumer needs. It helps to get an idea of a customers preferences by inspecting his behavior.

5 0
3 years ago
. List down mental health problems that may arises with excessive use of digital social networking Do we ever need to be concern
Snowcat [4.5K]

Answer:

Excessive utilization of digital instant messaging could perhaps lead to numerous mental health conditions.

Explanation:

  • The massive pressure just to preserve a privileged lifestyle the same as peer group and other such influencers.
  • Cyberbullying would also be a key component of the social mainstream press. This might cause stress.

Yes, researchers undoubtedly need to worry about who becomes familiar with the internet. There's a whole number of news items living with the effects of over-using social networking sites. There seemed to be headlines that a teen must have been strongly affected by someone with a man as well as ransacked with real money by encouraging them to stay married to her.

8 0
3 years ago
Given a variable, polygon_sides, that is associated with a dictionary that maps names of polygons to number of sides, create a n
sveticcg [70]

Answer:

polygon_sides = {"Triangle" : 3,"Square" : 5}

n_polygons = {}

for key in polygon_sides:

   n_polygons[polygon_sides[key]] = key

print("Polygon sides: ", polygon_sides)

print("Names of polygons: ", n_polygons)

Explanation:

  • Initialize the polygon_sides dictionary.
  • Loop through polygon_sides dictionary and assign the associated names to n_polygons variable.
  • Display the polygon sides and the names of polygons.
3 0
3 years ago
Write a program that reads a target string from the keyboard and then another sentence string from the keyboard.
Rzqust [24]

The solution is in the attachment

5 0
3 years ago
Intranets:
SOVA2 [1]

Answer:

A, C, D and E

Explanation:

An intranet is synonymous to a private LAN or WAN network but in contrast to the extranet or internet. Resources are retrieved and/ or shared within devices in the private network. It uses the internet protocol suite model of networking for communication, but also uses private IP addresses, which are not routable on the internet.

The communication between devices can be a peer to peer connection or client-server connection, using the mainframe computer technologies as the dedicated servers of the network.

7 0
4 years ago
Other questions:
  • What is the last step when supervising detainee operations ssd1?
    14·1 answer
  • When you buy a trackphone, do you have to pay a monthly wage or do you just need to buy the minutes and that's all?
    13·2 answers
  • Simpson is trying to solve an equation related to converting a decimal number to its hexadecimal form. He decides to utilize the
    6·1 answer
  • Convert the following Base 2 (binary) numbers to base 10(decimal):<br> 11101<br> 1010101
    13·1 answer
  • Write a method that accepts a String object as an argument and returns a copy of the string with the first character of each sen
    14·1 answer
  • The addresses a program may use to reference memory are distinguished from the addresses the memory system uses to identify phys
    15·1 answer
  • What is a quasi vpn?
    14·1 answer
  • You compared each letter in the correct word to the letter guessed.
    5·1 answer
  • The negotiation process involves several steps such as: preparing for negotiation; knowing your walk-away point; and working tow
    14·1 answer
  • One driving technique to increase fuel efficiency is.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!