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
The pads are 200mm long, 150 mm wide and thickness equal to 12mm. 1- Determine the average shear strain in the rubber if the for
lord [1]

Answer:

a) 0.3

b) 3.6 mm

Explanation:

Given

Length of the pads, l = 200 mm = 0.2 m

Width of the pads, b = 150 mm = 0.15 m

Thickness of the pads, t = 12 mm = 0.012 m

Force on the rubber, P = 15 kN

Shear modulus on the rubber, G = 830 GPa

The average shear strain can be gotten by

τ(average) = (P/2) / bl

τ(average) = (15/2) / (0.15 * 0.2)

τ(average) = 7.5 / 0.03

τ(average) = 250 kPa

γ(average) = τ(average) / G

γ(average) = 250 kPa / 830 kPa

γ(average) = 0.3

horizontal displacement,

δ = γ(average) * t

δ = 0.3 * 12

δ = 3.6 mm

5 0
3 years ago
Technician A says that mechanical shifting controls can wear out over time. Technician B says that vacuum control rubber diaphra
diamong [38]

Based on the information, both technician A and technician B are correct.

<h3>How to depict the information?</h3>

From the information given, Technician A says that mechanical shifting controls can wear out over time.

Technician B says that vacuum control rubber diaphragms can deteriorate over time.

In this case, both technicians are correct as the information depicted is true.

Learn more about technicians on:

brainly.com/question/1548867

#SPJ12

8 0
2 years ago
What is the instantaneous center of zero velocity? List two approaches for determining the is the instantaneous center of zero v
Lera25 [3.4K]

Explanation:

Instantaneous center:

   It is the center about a body moves in planer motion.The velocity of Instantaneous center is zero and Instantaneous center can be lie out side or inside the body.About this center every particle of a body rotates.

From the diagram

Where these two lines will cut then it will the I-Center.Point A and B is moving perpendicular to the point I.

If we take three link link1,link2 and link3 then I center of these three link will be in one straight line It means that they will be co-linear.

I_{12},I_{23},I_{31} all\ are\ co-linear.

5 0
3 years ago
The two windings of transformer is: a)- Conductively linked. b)- Not linked at all. c)- Inductively linked d)- Electrically link
kondor19780726 [428]

The two windings of transformer is c)- Inductively linked

Hope this helped!

4 0
3 years ago
Read 2 more answers
If the tank is designed to withstand a pressure of 5 MPaMPa, determine the required minimum wall thickness to the nearest millim
dmitriy555 [2]

Answer: hello some aspects of your question is missing below is the missing information

The gas tank is made from A-36 steel and has an inner diameter of 1.50 m.

answer:

≈ 22.5 mm

Explanation:

Given data:

Inner diameter = 1.5 m

pressure = 5 MPa

factor of safety = 1.5

<u>Calculate the required minimum wall thickness</u>

maximum-shear-stress theory ( σ allow ) = σγ / FS

                                                  = 250(10)^6 / 1.5  = 166.67 (10^6) Pa

given that |σ| = σ allow  

3.75 (10^6) / t = 166.67 (10^6)

∴ t ( wall thickness ) = 0.0225 m   ≈ 22.5 mm

4 0
2 years ago
Other questions:
  • The steel water pipe has an inner diameter of 12 in. and a wall thickness of 0.25 in. If the valve A is closed and the water pre
    10·1 answer
  • The voltage across a device and the current through it are:
    9·2 answers
  • Are all transmissions fluids interchangeable
    5·1 answer
  • 2.4: Add a method called setValue(), and the description of setValue is: public int setValue(long searchKey) In this method, the
    13·1 answer
  • Describe the algorithm you use for looking up a person’s telephone number in the phone book. The input is person’s name; the out
    9·2 answers
  • Employees cannot be held legally responsible for an environmental violation.
    14·1 answer
  • 2. What is the most obvious elements of design?<br> O color<br> O shape<br> O line<br> O texture
    11·1 answer
  • Typical noise associated with failed cv joint​
    14·1 answer
  • There are three different types of slings. What determines which type you use?
    13·1 answer
  • Assume the availability of an existing class, ICalculator, that models an integer arithmetic calculator and contains: an instanc
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!