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
LenKa [72]
4 years ago
13

Write a script named dif.py. This script should prompt the user for the names of two text files and compare the contents of the

two files to see if they are the same. If they are, the script should simply output "Yes". If they are not, the script should output "No", followed by the first lines of each file that differ from each other. The input loop should read and compare lines from each file. The loop should break as soon as a pair of different lines is found. Below are examples of the program input and output along with relevant files:
Engineering
1 answer:
Ainat [17]4 years ago
7 0

Answer:

1

Created on Nov 3, 2018 @author: ASLand

7import atexit

#Read, nanes of both files

Rrintll"Enter tvo files to be compared below

userliamel input ("Enter the nome of the first file: ")

userliame2 input("Enter the name of the second file: ")

ROpen each file

f1 - open(userNamel, r')

@17 f2 = opan(useriame 2, )

tread all the lines into a list

d1 f1.readlines ()

d2 f2.readlines()

re equivalent, print "Yes" else pri

oiterate, and conpare

#11

the

y

if dl == d2:

print("Yes")

atexit

elif for i in range(@, min(len (d1), len(d2))):

if di[i]!=d2[i]:

PCint("No")

print(d1[i])

pcint(d2[])

You might be interested in
Dampers dampers springs are used inside some valve spring to
harkovskaia [24]
The correct answer is A. Retain. Valve Stem seals
3 0
4 years ago
Two sections of a pressure vessel are to be held together by 5/8 in-11 UNC grade 5 bolts. You are told that the length of the bo
DiKsa [7]

Answer:

The solution and complete explanation for the above question and mentioned conditions is given below in the attached document.i hope my explanation will help you in understanding this particular question.

Explanation:

7 0
3 years ago
A rod of aluminum has a square 4.5 mm × 4.5 mm cross section and length of 2.0 m. (A) What is the resistance of the rod along it
zimovet [89]

Answer:

The solution is attached below:

Explanation:

8 0
3 years ago
In the truss below, the vertical reaction force at A is
Montano1993 [528]
It’s c trust just trust
7 0
3 years ago
When groups of molecules within liquid and gases move, it is called
steposvetlana [31]

Answer:

convenction is your answer

7 0
3 years ago
Other questions:
  • Refrigerant-134a enters a 28-cm-diameter pipe steadily at 200 kPa and 20°C with a velocity of 5 m/s. The refrigerant gains heat
    15·1 answer
  • Is any one there <br><br>I am 1m b0r3d<br>I will mark you as Brainliest
    5·2 answers
  • Instruments in airplane A indicate that with respect to the air the plane is headed 30◦ north of east with an airspeed of 300 mi
    5·1 answer
  • Air at 105 kPa and 37° C flows upward through a6-cm-diameter inclined duct at a rate of 65 L/s. The duct diameter is then reduce
    12·1 answer
  • ______________ help protect the lower legs and feet from heat hazards like molten metal and welding sparks. A) Safety shoesB) Le
    7·1 answer
  • HIIIIIIIIII htrdcvbnjuytresdxcvbnjhytrdefghjkmnbvcdertyhjmn i'm soo bored
    9·2 answers
  • Catalytic converters reduce the engine's tailpipe emissions of unburned hydrocarbons and carbon monoxide and
    6·2 answers
  • The radiation meter is showing radiation 2x as much as background. Is this a hot zone? If so why or why not?
    9·1 answer
  • Please help me. I have no idea what I'm doing.​
    14·2 answers
  • The Web and Digital Communications pathway is broken down into four main categories of technology. Which category BEST describes
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!