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
Air is to be compressed so that its volume is reduced to half of its original volume if the initial pressure is 200 kPa and the
Alex_Xolod [135]

Answer:

P_{2} = 527.803\,kPa

Explanation:

The politropic relationship for a isentropic process is:

\frac{P_{2}}{P_{1}} = \left(\frac{V_{1}}{V_{2}}  \right)^{\gamma}

Where \gamma is the ratio of specific heats

The final pressure is:

P_{2} = P_{1}\cdot \left(\frac{V_{1}}{V_{2}}\right)^{\gamma}

P_{2} = (200\,kPa)\cdot (2)^{1.4}

P_{2} = 527.803\,kPa

7 0
3 years ago
(a) What is the distinction between hypoeutectoid and hypereutectoid steels? (b) In a hypoeutectoid steel, both eutectoid and pr
Gnoma [55]

Answer:

See explanation below

Explanation:

Hypo-eutectoid steel has less than 0,8% of C in its composition.

It is composed by pearlite and α-ferrite, whereas Hyper-eutectoid steel has between 0.8% and 2% of C, composed by pearlite and cementite.

Ferrite has a higher tensile strength than cementite but cementite is harder.

Considering that hypoeutectoid steel contains ferrite at grain boundaries and pearlite inside grains whereas hypereutectoid steel contains a higher amount of cementite, the following properties are obtainable:

Hypo-eutectoid steel has higher yield strength than Hyper-eutectoid steel

Hypo-eutectoid steel is more ductile than Hyper-eutectoid steel

Hyper-eutectoid steel is harder than Hyper-eutectoid steel

Hypo-eutectoid steel has more tensile strength than Hyper-eutectoid steel.

When making a knife or axe blade, I would choose Hyper-eutectoid steel alloy because

1. It is harder

2. It has low cost

3. It is lighter

When making a die to press powders or stamp a softer metals, I will choose hypo-eutectoid steel alloy because

1. It is ductile

2. It has high tensile strength

3. It is durable

7 0
3 years ago
Read 2 more answers
The pressure distribution over a section of a two-dimensional wing at 4 degrees of incidence may be approximated as follows: Upp
Aliun [14]

Answer:

The lift coefficient is 0.3192 while that of the moment about the leading edge is-0.1306.

Explanation:

The Upper Surface Cp is given as

Cp_u=-0.8 *0.6 +0.1 \int\limits^1_{0.6} \, dx =-0.8*0.6+0.4*0.1

The Lower Surface Cp is given as

Cp_l=-0.4 *0.6 +0.1 \int\limits^1_{0.6} \, dx =-0.4*0.6+0.4*0.1

The difference of the Cp over the airfoil is given as

\Delta Cp=Cp_l-Cp_u\\\Delta Cp=-0.4*0.6+0.4*0.1-(-0.8*0.6-0.4*0.1)\\\Delta Cp=-0.4*0.6+0.4*0.1+0.8*0.6+0.4*0.1\\\Delta Cp=0.4*0.6+0.4*0.2\\\Delta Cp=0.32

Now the Lift Coefficient is given as

C_L=\Delta C_p cos(\alpha_i)\\C_L=0.32\times cos(4*\frac{\pi}{180})\\C_L=0.3192

Now the coefficient of moment about the leading edge is given as

C_M=-0.3*0.4*0.6-(0.6+\dfrac{0.4}{3})*0.2*0.4\\C_M=-0.1306

So the lift coefficient is 0.3192 while that of the moment about the leading edge is-0.1306.

5 0
3 years ago
A priority encoder circuit has four inputs,X3-0. The circuit has three outputs: Z,Y1-0. If any of X3-0is 1, then Zis 1, and Y re
sladkih [1.3K]

Answer:

Detailed solution is given below:

3 0
3 years ago
What should you use to keep battery terminals from corroding
Ray Of Light [21]

Answer: Apply battery-terminal grease to the terminals to help prevent corrosion. It's available at any auto parts store and usually comes in a little ketchup-like packet. Another great option is AMSOIL Heavy-Duty Metal Protector. It creates a protective coating on terminals that wards off corrosion.

Explanation:

3 0
3 years ago
Other questions:
  • A team member who has been a good worker for many years has recently been doing poor work. You suspect that he may be tired of h
    6·1 answer
  • A turntable A is built into a stage for use in a theatrical production. It is observed during a rehearsal that a trunk B starts
    5·1 answer
  • Find Ix, Iy, and J for the following shapes. In addition, find the radius of gyration (r) with respect to the x axis and y axis
    5·1 answer
  • . . . . . . . . . . ..........
    8·1 answer
  • A hubbing press has capasity of 175tons. If the workpice ia a copper alloy part with a 2in^2 projected area, what is the stronge
    10·1 answer
  • The engineer must place a catch basin at the north west corner of the yard of a subdivision lot. The catchment area will be calc
    5·1 answer
  • How long...you...novels? A. Have/write B. Do/write C. Have/written D. Did/go
    8·2 answers
  • Name the manufacturing process that the worker is using to create the workpiece. The manufacturing process carried out by the bl
    6·1 answer
  • 10. In CCS, Northing and Easting are
    15·1 answer
  • Which option shows the most valuable metallic properties
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!