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]
3 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]3 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
If 200 amperes flow from the positive terminal of a battery and operate the starter motor, how many amperes will flow back to th
garri49 [273]

Answer:

200 Amperes WB =<em> </em>200J

Explanation:

200 Amperes will flow back to the negative terminal because both the positive terminal and negative terminal contain the equivalent amount of current that will flow and it works in the starter motor.

To learn more about it, refer

to brainly.com/question/6561461

#SPJ4

5 0
1 year ago
Why does the auto industry prefer uniform (national) standards for automobile emissions as opposed to regionally varying standar
WINSTONCH [101]

Answer:

Explanation:

For automobile emission, a uniform standard is preferred, because no unnecessary advantage is given by it to any company that is located in particular states where the regional standards are less severe.

Since pollution has its impact across the states and in the whole of the USA, then there should be uniform standards across all the states. It will also invalidate the impact of regional standards as a factor in the selection of plant locations for the automobile company. It means that a state offering less valid emission standards, will attract more companies to herself and it will be against the other states who care more about the natural environment. It can make more states to opt for the permissive emission standards, that will be more harmful to the USA as a country, than the good. So, a uniform standard is preferred to eliminate it as a factor in plant location decisions.

Yes, uniform standards are beneficial to everyone, because it will bring effective control upon the pollution level because there will be no state where the culprit firm can hide. Besides, it is more effective as efforts done towards environment conservation.

3 0
3 years ago
Which of the following factors does not promote safety in the shop?
sergey [27]
“Thinking about pleasant things to pass the time” would not promote safety in the shop because it would be taking the focus away from important tasks, which in turn decreases safety.
6 0
3 years ago
Consider a simply supported rectangular beam with a span length of 10 ft, a width of 8 in, and an effective depth of 20 in. Norm
yulyashka [42]

Answer:

beam with a span length of 10 ft, a width of 8 in, and an effective depth of 20 in. Normal weight concrete is used for the beam. This beam carries a total factored load of 9.4 kips. The beam is reinforced with tensile steel, which continues uninterrupted into the support. The concrete has a strength of 4000 psi, and the yield strength of the steel is 60,000 psi. Using No. 3 bars and 60,000 psi steel for stirrups, do the followings:

8 0
2 years ago
PLEASE QUICK!!! what phrase describes an ad hominem fallacy?
Igoryamba

Answer:

personal attack

Explanation:

it is personal attack

5 0
2 years ago
Other questions:
  • A rectangular channel 6 m wide with a depth of flow of 3m has a mean velocity of 1.5 m/sec. The channel undergoes a smooth, grad
    7·1 answer
  • For a heat pump, COP&lt;1. a) True b) False
    11·1 answer
  • Look at the data set below.
    15·2 answers
  • What is productivity as it relates to labor?
    11·1 answer
  • A venturi meter is to be installed in a 63 mm bore section of a piping system to measure the flow rate of water in it. From spac
    15·1 answer
  • write an interface downloadable that has a method "geturl" that returns the url of a downloadable object
    5·1 answer
  • How do you connect several springs to increase the equivalent stiffness? What is one example from industry or other real-life si
    7·1 answer
  • Which of the following sentences uses the word malleable correctly?
    7·2 answers
  • The Web and Digital Communications pathway is broken down into four main categories of technology. Which category BEST describes
    13·1 answer
  • Jade wanted to test the effect of ice on the weathering of rocks. She filled two containers with gypsum and placed a water ballo
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!