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
Name two types of battery chargers that are used in mechanics
tekilochka [14]
Primary batteries
Secondary batteries
7 0
3 years ago
A pressure cylinder has an outer diameter 200 mm, maximum external pressure 4 MPa, and maximum allowable shear stress 27.5 MPa.
ludmilkaskok [199]

Answer:

The minimum value of wall thickness t=3.63 mm.

Explanation:

Given:

  D=200 mm

 P=4 MPa

t= Wall thickness

maximum shear stress=27.5 MPa

We know that

       hoop stress \sigma _{h}=\frac{Pd}{2t}

      Longitudinal stress \sigma _{l}=\frac{Pd}{4t}

So maximum shear tress in plane\tau _{max}=\dfrac{\sigma _h-\sigma _l}{2}

              \tau _{max}=\dfrac{Pd}{8t}

Now by putting the value

       27.5=\dfrac{4\times 200}{8t}

 So   t=3.36 mm

The minimum value of wall thickness t=3.63 mm.

4 0
3 years ago
Five bolts are used in the connection between the axial member and the support. The ultimate shear strength of the bolts is 320
lesya [120]

Answer:

The minimum allowable bolt diameter required to support an applied load of P = 450 kN is 45.7 milimeters.

Explanation:

The complete statement of this question is "Five bolts are used in the connection between the axial member and the support. The ultimate shear strength of the bolts is 320 MPa, and a factor of safety of 4.2 is required with respect to fracture. Determine the minimum allowable bolt diameter required to support an applied load of P = 450 kN"

Each bolt is subjected to shear forces. In this case, safety factor is the ratio of the ultimate shear strength to maximum allowable shear stress. That is to say:

n = \frac{S_{uts}}{\tau_{max}}

Where:

n - Safety factor, dimensionless.

S_{uts} - Ultimate shear strength, measured in pascals.

\tau_{max} - Maximum allowable shear stress, measured in pascals.

The maximum allowable shear stress is consequently cleared and computed: (n = 4.2, S_{uts} = 320\times 10^{6}\,Pa)

\tau_{max} = \frac{S_{uts}}{n}

\tau_{max} = \frac{320\times 10^{6}\,Pa}{4.2}

\tau_{max} = 76.190\times 10^{6}\,Pa

Since each bolt has a circular cross section area and assuming the shear stress is not distributed uniformly, shear stress is calculated by:

\tau_{max} = \frac{4}{3} \cdot \frac{V}{A}

Where:

\tau_{max} - Maximum allowable shear stress, measured in pascals.

V - Shear force, measured in kilonewtons.

A - Cross section area, measured in square meters.

As connection consist on five bolts, shear force is equal to a fifth of the applied load. That is:

V = \frac{P}{5}

V = \frac{450\,kN}{5}

V = 90\,kN

The minimum allowable cross section area is cleared in the shearing stress equation:

A = \frac{4}{3}\cdot \frac{V}{\tau_{max}}

If V = 90\,kN and \tau_{max} = 76.190\times 10^{3}\,kPa, the minimum allowable cross section area is:

A = \frac{4}{3} \cdot \frac{90\,kN}{76.190\times 10^{3}\,kPa}

A = 1.640\times 10^{-3}\,m^{2}

The minimum allowable cross section area can be determined in terms of minimum allowable bolt diameter by means of this expression:

A = \frac{\pi}{4}\cdot D^{2}

The diameter is now cleared and computed:

D = \sqrt{\frac{4}{\pi}\cdot A}

D =\sqrt{\frac{4}{\pi}\cdot (1.640\times 10^{-3}\,m^{2})

D = 0.0457\,m

D = 45.7\,mm

The minimum allowable bolt diameter required to support an applied load of P = 450 kN is 45.7 milimeters.

5 0
3 years ago
Types of technology include:
Anastaziya [24]
The answer is D-all choices
3 0
3 years ago
Verify if 83 is a term in the arithmetic sequence 11,15,19,23
EleoNora [17]

Answer:

yes, it is

Explanation:

The sequence: (+4)

23,27,31,35,39,43,47,51,55,59,63,67,71,75,79,83

Hope this helps! :)

3 0
3 years ago
Other questions:
  • Consider two electrochemical reaqctions. Reaction A results in the transfer of 2 mol of electrons per mole of reactant and gener
    14·2 answers
  • Technician A says a basic circuit problem can be caused by something in the circuit that increases voltage. Technician B says a
    8·1 answer
  • What is the base unit in standard measurement
    13·2 answers
  • the frequencies 10, 12, 23 and 45 Hz. (a) What is the minimum sampling rate required to avoid aliasing? (b) If you sample at 40
    13·1 answer
  • Water evaporating from a pond does so as if it were diffusing across an air film 0.15 cm thick. The diffusion coefficient of wat
    8·1 answer
  • A Barnes and Books is interested in purchasing a two-story building for a new
    5·1 answer
  • can someone please define these three vocabulary words for my stem class i will give brainliest if i can figure out how
    15·1 answer
  • Question Completion Status:
    6·1 answer
  • Explain race condition..<br><br>don't spam..​
    13·2 answers
  • Imagine the arc of a football as it flies through the air. How does this motion illustrate classical mechanics?
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!