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
A plant has ten machines and currently operates two 8-hr shift per day, 5 days per week, 50 weeks per year. the ten machines pro
Zarrin [17]

Answer:

  83.6%

Explanation:

<h3>(a)</h3>

On its current schedule, the plant can theoretically produce ...

  (30 pc/h/machine)(10 machine)(8 h/shift)(2 shift/day)(5 day/wk)(50 wk/yr)

  = (30)(10)(8)(2)(5)(50) pc/yr = 1,200,000 pc/yr

__

<h3>(b)</h3>

On the proposed schedule, this production becomes ...

  (30 pc/mach)(10 mach)(8 h/sh)(3 sh/da)(6 da/wk)(51 wk/yr)

  = (30)(10)(8)(3)(6)(51) pc/yr = 2,203,200 pc/yr

The increase in capacity is ...

  (2,203,200/1,200,000 -1) × 100% = 83.6% . . . capacity increase

_____

<em>Additional comment</em>

The number of parts per shift did not change. Only the number of shifts per year changed. It went up by a factor of (3/2)(6/5)(51/50) = 1.836. Hence the 83.6% increase in capacity.

We have to assume that maintenance and repair are done as effectvely as before in the reduced down time that each machine has.

3 0
2 years ago
A liquid-liquid extraction process consists of two units, a mixer and a separator. One inlet stream to the mixer consists of two
vesna_86 [32]

Answer:

One inlet stream to the mixer flows at 100.0 kg/hr and is 35wt% species-A and 65wt% species-B.

Explanation:

8 0
3 years ago
21. How long can food that requires time-temperature control be left in the danger zone?
dimulka [17.4K]

Answer: A maximum of 1 hour

Explanation:

Read your lesson buddy!!

8 0
3 years ago
Read 2 more answers
How does the clearance volume affect the efficiency of the Otto cycle?
eduard

Answer:

Explanation:

A smaller clearance volume means a higher compression. A higher compression means better thermal efficiency. However a compression ratio too high might be troublesome, as it can cause accidental ignition of the fuel-air mix. This is the reason why Otto cycle engines have lower compressions that Diesel engines. In a Diesel engine the mix ignites by compression instead of a spark.

7 0
3 years ago
A single fixed pulley is used to lift a load of 400N by the application of an effort of 480N in 10s through a vertical height of
Allushta [10]

Answer:

(a) the velocity ratio of the machine (V.R) = 1

(b) The mechanical advantage of the machine (M.A) = 0.833

(c) The efficiency of the machine (E) = 83.3 %

Explanation:

Given;

load lifted by the pulley, L = 400 N

effort applied in lifting the, E = 480 N

distance moved by the effort, d = 5 m

(a) the velocity ratio of the machine (V.R);

since the effort applied moved downwards through a distance of d, the load will also move upwards through an equal distance 'd'.

V.R = distance moved by effort / distance moved by the load

V.R = 5/5 = 1

(b) The mechanical advantage of the machine (M.A);

M.A = L/E

M.A = 400 / 480

M.A = 0.833

(c) The efficiency of the machine (E);

E = \frac{M.A}{V.R} \times 100\%\\\\E = 0.833 \ \times \ 100\%\\\\ E = 83.3 \ \%

4 0
3 years ago
Other questions:
  • In this milestone we will create a Course class to represent a course and display its information on the screen. We will create
    9·1 answer
  • Electricity is generated in two forms namely………A. Alternating current and wave form B. Alternating current and basic current C.
    7·2 answers
  • Show that the solution of thin airfoil theory of a symmetric airfoil given below satisfies the Kutta condition. What angle of at
    11·1 answer
  • Generally the primary source of all water supply is to be said as
    5·2 answers
  • Which section of business plan should be the bulk of the plan
    7·1 answer
  • What's the best way to find the load capacity of a crane? Select the best option. Call the manufacturer Ask co-workers Look at t
    8·1 answer
  • 12. A structural component is fabricated from an alloy that has a plane strain fracture toughness of It has been determined that
    11·1 answer
  • What drives up the cost of consumables?
    6·1 answer
  • Tech A says that LED brake lights illuminate faster than incandescent bulbs. Tech B says that LED brake lights have
    13·1 answer
  • ) If the blood viscosity is 2.7x10-3 Pa.s, length of the blood vessel is 1 m, radius of the blood vessel is 1 mm, calculate the
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!