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
Air is contained in a vertical piston–cylinder assembly such that the piston is in static equilibrium. The atmosphere exerts a p
oee [108]

Answer:

a) 24 kg

b) 32 kg

Explanation:

The gauge pressure is of the gas is equal to the weight of the piston divided by its area:

p = P / A

p = m * g / (π/4 * d^2)

Rearranging

p * (π/4 * d^2) = m * g

m = p * (π/4 * d^2) / g

m = 1200 * (π/4 * 0.5^2) / 9.81 = 24 kg

After the weight is added the gauge pressure is 2.8kPa

The mass of piston plus addded weight is

m2 = 2800 * (π/4 * 0.5^2) / 9.81 = 56 kg

56 - 24 = 32 kg

The mass of the added weight is 32 kg.

5 0
2 years ago
Which one is suitable for industries petrol engine or diesel engine and why?
klio [65]

Answer:

diesel engine

Explanation:

because diesel is stronger than petrol

3 0
3 years ago
Read 2 more answers
Hello , how are yall:))))
SVEN [57.7K]

Answer:

eh I'm good hbu?????????

6 0
2 years ago
Read 2 more answers
What components are included in a basic engine block?
atroni [7]
Houses the CYLINDERS, Water Jacket & Crankcase
8 0
2 years ago
Pls follow me in brainly​
Sergio [31]

Answer:

sure

Add on:

!!

5 0
3 years ago
Read 2 more answers
Other questions:
  • Classify the terms as related to a thermal system or mechanical system.
    8·1 answer
  • Please answer question #2
    6·1 answer
  • The point in an electrical circuit that is connected to the negative side of a power supply is called what?
    8·1 answer
  • Air pressure is higher above an airfoil.<br> true or false
    14·1 answer
  • Write multiple if statements
    5·1 answer
  • How long does it take electrons to get from a car battery to the starting motor? Assume the current is 300 A and the electrons t
    10·1 answer
  • 1 kg of oxygen is heated from 20 to 120°C. Determine the amount of heat transfer required when this is done during a (a) constan
    7·1 answer
  • A private plane pilot is what kind of individual transportation position? professional level mid-level entry-level EPA-certified
    9·1 answer
  • In a hydraulic system, a 100.-newton force is applied to a small piston with an area of 0.0020 m2. What pressure, in pascals, wi
    13·1 answer
  • What are the philological elements of interior design most like?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!