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
A(n) _____ is an apparatus that changes alternating current (AC) to direct current (DC)
amid [387]

Answer:

rectifier

Explanation:

7 0
2 years ago
Water at 20 °C is flowing with velocity of 0.5 m/s between two parallel flat plates placed 1 cm apart. Determine the distances f
Basile [38]

Answer:

The distance from the entrance at which the boundary layers meet is 0.516m

The distance from the entrance at which the thermal boundary layers meet is 1.89m

Explanation:

For explanation, look at the attached file

3 0
3 years ago
The mechanical advantage of a screw is always ____________________ than/to 1. Question 5 options: less, greater, equal, none of
torisob [31]

Answer:well u can use to make a shelter but that's all I can think of ??

Explanation:

3 0
3 years ago
Takt time is the rate at which a factory must produce to satisfy the customer's demand. a)- True b)- False
laila [671]

Answer: a)True

Explanation: Takt time is defined as the average time difference between  the production of the two consecutive unit of goods by the manufacturer and this rate is matched with the demand of the customer. This is the time which is calculated to find the acceptable time for which the goods unit must be produced  by the factory to meet the needs of the customer. Therefore , the statement is true that takt time is the rate at which a factory must produce to satisfy the customer's demand.

6 0
3 years ago
Say that a variable A in CFG G is necessary if it appears in every derivation of some string w ∈ G. Let NECESSARY CFG = {hG, Ai|
ale4655 [162]

Answer:

Explanation:

solution

8 0
3 years ago
Read 2 more answers
Other questions:
  • Q5. A hypothetical metal alloy has a grain diameter of 2.4 x 10-2 mm. After a heat treatment at 575°C for 500 min, the grain dia
    7·1 answer
  • Thermal energy storage systems commonly involve a packed bed of solid spheres, through which a hot gas flows if the system is be
    13·1 answer
  • Someone claims that the shear stress at the center of a circular pipe during fully developed laminar flow is zero. Do you agree
    12·1 answer
  • The pressure forces on a submersed object will be (A)- Tangential to the objects body (B)- Parallel (C)- Normal (D)- None of the
    10·1 answer
  • What must you do if hauling a load of material which could fall or blow onto the roadway?
    14·1 answer
  • Which factors influence changes in consumer demands? check all that apply
    8·2 answers
  • Air at 20 C and 1 atm flows over a flat plate at 35 m/s. The plate is 75 cm long and is maintained at 60 с. Assuming unit depth
    8·1 answer
  • 1. The area of the given triangle is 25 square units. What is the value of x?<br> X+2
    8·1 answer
  • What is 203593^54/38n^7
    6·1 answer
  • Which of the following parts tells the transmission how fast or slowly a vehicle is going? A) pump
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!