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
Which of the following hazards is shared by surface mining and sub-surface mining?
lubasha [3.4K]

B I guess. since they both have potential to collapse

4 0
3 years ago
Read 2 more answers
Individual/organizations who are responsible for monitoring, verifying, and sometimes certifying various aspects of the construc
Rus_ich [418]

The project or the site manager is responsible for monitoring or verifying the aspects of the construction process.

The site or the project manager is the individual that is responsible for the adherence to quality and guidance on the construction site.

The site or project manager has the following tasks

  • ensuring safety on the site
  • Monitoring the progress or the work that is being done
  • Sourcing materials
  • Solving problems

In conclusion, the project manager monitors and verifies aspects of the construction process.

Read more on brainly.com/question/24887827?referrer=searchResults

8 0
2 years ago
True or False? Early engineers used a trial-and­error approach, rather than mathematical and scientific principles when solving
yarga [219]

Answer:

<h2>True Most Especially in the field of Automotive Engineering</h2>

Explanation:

Normally, before the introduction of vehicle diagnostics when a vehicle, mostly automobile/car break down, one could be the vehicle mechanic would only suspect one or two related faults based on the present working condition of the car, the mechanic would perform some trial and error before he could fix the car.

But in recent times, the introduction of vehicle diagnostics devices and software has changed the order as vehicles can be connected to a computer that will scan and tell what   the problem is before a possible fix.

3 0
2 years ago
Let r be a bank's interest rate in percent per year (APR). An initial amount of money P, also called as principal, will mature t
Liono4ka [1.6K]

Answer:

See explanation below.

Explanation:

For this case the program needs to take the inputs as P,r and n and the output would be as A and printed on the system. The code is:

# Inputs

P = float(input("Enter the present value : "))  

r = float(input("Enter your APR : "))  

n = float(input("Enter the number of years : ") )

# Output

A = P*(1 +(r/100))**n

print("The future values is:", A)  

And the result obtained is:

Enter the present value : 1000

Enter your APR : 0.95

Enter the number of years : 5

The future values is: 1048.4111145526908

7 0
3 years ago
A rectangular channel 6 m wide with a depth of flow of 3 m has a mean velocity of 1.5 m/s. The channel undergoes a smooth, gradu
Trava [24]

Answer:

Depth in the contracted section = 2.896m

Velocity in the contracted section = 2.072m/s

Explanation:

Please see that attachment for the solving.

Assumptions:

1. Negligible head losses

2. Horizontal channel bottom

7 0
3 years ago
Other questions:
  • The head difference between the inlet and outlet of a 1km long pipe discharging 0.1 m^3/s of water is 0.53 m. If the diameter is
    11·1 answer
  • A water jet jump involves a jet cross-sectional area of 0.01 m2 , and a jet velocity of 30 m/s. The jet is surrounded by entrain
    6·1 answer
  • Design a decimal arithmetic unit with two selection variables, V1, and Vo, and two BCD digits, A and B. The unit should have fou
    7·1 answer
  • Looking at the response vehicles (pictured above), explain two options you have in order to abide by the Move
    8·1 answer
  • Part of the following pseudocode is incompatible with the Java, Python, C, and C++ language Identify the problem. How would you
    12·1 answer
  • When handling chemicals and solvents, technicians are recommended to
    10·2 answers
  • What is definition of<br>computational fluid Dynamics <br>unstructured grid <br>domain<br>geometry​
    6·1 answer
  • Plzzzz helppp design process in order
    12·1 answer
  • Draw the ipo chart for a program that reads a number from the user and display the square of that number ???Anyone please
    11·1 answer
  • Which of the following is a Dashboard Scoreboard for alignment of the business where information is constantly flowing through t
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!