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
While there are many ways to solve this problem, one strategy is to calculate the volume of any metal's unit cell given its theo
IgorC [24]

Answer:

V_{c}=1.396x10^{-28}  m^{3} /unit.cell

Explanation:

z = number of atoms

M = Molar mass of zirconium

N = Avogadro’s number

Vc = volume of zirconium unit cell

d = density

z=12x\frac{1}{6}+2x\frac{1}{2}+3=6

z = 6 atoms per unit cell

M = 91.224 g/mol

N = 6.023x10^{23}  atoms/mol

d = 6.51g/cm^{3}

V_{c}=\frac{zxM}{dxN}

V_{c}=\frac{6x(91.224g/mol)}{(6.51g/cm^{3}) x(6.023x10^{23}atoms/mol) }

V_{c}=1.396x10^{-22}  cm^{3} /unit.cell

V_{c}=1.396x10^{-28}  m^{3} /unit.cell

8 0
3 years ago
A well-established way of power generation involves the utilization of geothermal energy-the energy of hot water that exists nat
jeka94

Answer:

the maximum thermal efficiency is 29%

Explanation:

the maximum efficiency for a thermal engine that works between a cold source and a hot source is the one of a Carnot engine. Its efficiency is given by

Maximum efficiency= 1 - T2/T1

where

T2= absolute temperature of the cold sink (environment)= 20°C + 273 = 293

T2= absolute temperature of the hot source (hot water supply) = 140°C + 273 = 413

therefore

Maximum efficiency= 1 - T2/T1 = 1 - 293/413 = 0,29 =29%

3 0
3 years ago
1 A power transmission includes a belt drive, a chain drive and a gear drive. Which of the following is the best arrangement bet
Setler79 [48]

Answer:d

Explanation:

(d) chain drive belt drive gear drive

3 0
3 years ago
Mnsdcbjksdhkjhvdskjbvfdfkjbcv hjb dfkjbkjfvvfebjkhbvefgjdf
Julli [10]

Answer:

ik true eedcggftggggfffff

8 0
3 years ago
Read 2 more answers
We are given a CSP with only binary constraints. Assume we run backtracking search with arc consistency as follows. Initially, w
sweet-ann [11.9K]
We are given a CSP with only binary can concentrate assume we run backtrackingSearch with ARC
8 0
3 years ago
Other questions:
  • A production plant has a requirement for a counter that will count 4,000 items before recycling and starting over. How many D fl
    15·1 answer
  • PLEASE HELP 100 POINTS!!! WILL MARK BRAINLIEST
    9·2 answers
  • A compression ignition engine when tested gave an indicator card having area 3250mm^2 and length 73mm. The calibration factor wa
    10·1 answer
  • Part of the basic procedures is the vehicle check. What does that mean?
    7·1 answer
  • Water of dynamic viscosity 1.12E-3 N*s/m2 flows in a pipe of 30 mm diameter. Calculate the largest flowrate for which laminar fl
    13·1 answer
  • Add my sc please?.<br><br> kindacracked
    12·2 answers
  • What parts do all circuits have in common?
    9·2 answers
  • Help please i will give brainlist
    9·2 answers
  • Please help me on this it’s due now
    14·1 answer
  • 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!