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
coldgirl [10]
3 years ago
8

Suppose the Bookstore is processing an input file containing the titles of books in order to remove duplicates from their list.

Write a program that reads all of the titles from an input file called bookTitles.txt and writes them to an output file called noDuplicates.txt. When complete, the output files should contain all unique titles found in the input file.
Engineering
1 answer:
mash [69]3 years ago
6 0

Answer:

books = []

   fp = open("bookTitles.txt")

   for line in fp.readlines():

       title = line.strip()

       if title not in books:

           books.append(title)

   fp.close()

   fout = open("noDuplicates.txt", "w")

   for title in books:

       print(tile, file=fout)

   fout.close()

except FileNotFoundError:

   print("Unable to open bookTitles.txt")

You might be interested in
A turbine operates at steady state, and experiences a heat loss. 1.1 kg/s of water flows through the system. The inlet is mainta
strojnjashka [21]

Answer:

\dot W_{out} = 399.47\,kW

Explanation:

The turbine is modelled after the First Law of Thermodynamics:

-\dot Q_{out} -\dot W_{out} + \dot m\cdot (h_{in}-h_{out}) = 0

The work done by the turbine is:

\dot W_{out} = \dot m \cdot (h_{in}-h_{out})-\dot Q_{out}

The properties of the water are obtained from property tables:

Inlet (Superheated Steam)

P = 10\,MPa

T = 520\,^{\textdegree}C

h = 3425.9\,\frac{kJ}{kg}

Outlet (Superheated Steam)

P = 1\,MPa

T = 280\,^{\textdegree}C

h = 3008.2\,\frac{kJ}{kg}

The work output is:

\dot W_{out} = \left(1.1\,\frac{kg}{s}\right)\cdot \left(3425.9\,\frac{kJ}{kg} -3008.2\,\frac{kJ}{kg}\right) - 60\,kW

\dot W_{out} = 399.47\,kW

5 0
3 years ago
What is NOT an example of professional networking?
gogolik [260]

Answer:

funfairs etc

Explanation:

6 0
3 years ago
A cylindrical brass rod has a length of 5.00cm extending from a holder and a diameter of 4.50mm. Its Young's modulus is 98.0GPa.
Galina-37 [17]

Answer:

elongation of the brass rod is 0.01956 mm

Explanation:

given data

length = 5 cm = 50 mm

diameter = 4.50 mm

Young's modulus = 98.0 GPa

load = 610 N

to find out

what will be the elongation of the brass rod in mm

solution

we know here change in length formula that is express as

δ = \frac{PL}{AE}    ................1

here δ is change in length and P is applied load  and A id cross section area and E is Young's modulus and L is length

so all value in equation 1

δ = \frac{PL}{AE}  

δ = \frac{610*50}{\frac{\pi}{4} * 4.50^2 * 98*10^3}  

δ = 0.01956 mm

so elongation of the brass rod is 0.01956 mm

7 0
3 years ago
Water is the working fluid in an ideal Rankine cycle. Saturated vapor enters the turbine at 12 MPa, and the condenser pressure i
Brilliant_brown [7]

Answer:

\dot Q_{in} = 372.239\,MW

Explanation:

The water enters to the pump as saturated liquid and equation is modelled after the First Law of Thermodynamics:

w_{in} + h_{in}- h_{out} = 0

h_{out} = w_{in}+h_{in}

h_{out} = 12\,\frac{kJ}{kg} + 191.81\,\frac{kJ}{kg}

h_{out} = 203.81\,\frac{kJ}{kg}

The boiler heats the water to the state of saturated vapor, whose specific enthalpy is:

h_{out} = 2685.4\,\frac{kJ}{kg}

The rate of heat transfer in the boiler is:

\dot Q_{in} = \left(150\,\frac{kg}{s}\right)\cdot \left(2685.4\,\frac{kJ}{kg}-203.81\,\frac{kJ}{kg} \right)\cdot \left(\frac{1\,MW}{1000\,kW} \right)

\dot Q_{in} = 372.239\,MW

3 0
2 years ago
Read 2 more answers
What is the braks mean effictive pressure?
OverLord2011 [107]

Engine cylinder pressure

<u>Explanation:</u>

  1. Brake mean effective pressure is a method to calculate  the engine cylinder pressure which  would give the measured brake horsepower. Brake mean effective pressure is used to identify engine efficiency regardless of capacity or engine speed.
  2. It is used to identify engine efficiency.It is measured by means of transducers or pressure gauges.
  3. It is the measure of engine capacity to do work.

7 0
3 years ago
Other questions:
  • Mobo, a wireless phone carrier, completed its first year of operations on October 31. All of the year's entries have been record
    5·1 answer
  • What are the seven problem solving steps?
    12·1 answer
  • A three-point bending test was performed on an aluminum oxide specimen having a circular cross section of radius 5.0 mm (0.20 in
    13·1 answer
  • Yield and tensile strengths and modulus of elasticity . with increasing temperature. (increase/decrease/independent)
    11·1 answer
  • Which utility program reads an assembly language source file and produces an object file?
    6·1 answer
  • If you play roblox leave user down bellow
    14·2 answers
  • The rolling process is governed by the frictional force between the rollers and the workpiece. The frictional force at the entra
    5·1 answer
  • For a steel alloy it has been determined that a carburizing heat treatment of 14 h duration at 809°C will raise the carbon conce
    13·1 answer
  • Which of the following is not a function of the suspension system?_____
    6·1 answer
  • Are there engineering students here?​
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!