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
An electric kettle is required to heat 0.64 kg of water from 15.4°C to 98.2°C in six
skelet666 [1.2K]

Answer:

Almost done

Explanation:

I am just finishing up my work

7 0
2 years ago
1. A thin-walled cylindrical pressure vessel is capped at the end and is subjected to an internal pressure (p). The inside diame
Vesna [10]
I DONT KNOW OKAY UGHHH
6 0
3 years ago
What is a radio wave made up of? Molecules? Electrons? Other?
mafiozo [28]

Radio waves are radiated by charged particles when they are accelerated. They are produced artificially by time-varying electric currents, consisting of electrons flowing back and forth in a specially-shaped metal conductor called an antenna. ... Radio waves are received by another antenna attached to a radio receiver.

4 0
3 years ago
Read 2 more answers
A crankcase heater is often used to prevent refrigerant from mixing with compressor oil during periods of:
stira [4]

Answer:

Low ambient temperature

Explanation:

Hope this helps. If it did, please mark as brianliest so other people see it. Thanks! - Kai

5 0
2 years ago
Read 2 more answers
Pumped-storage hydroelectricity is a type of hydroelectric energy storage used by electric power systems for load balancing. The
NikAS [45]

Answer:

A) energy loss E = pgQtH

Where p = density in kg/m3

g = gravity acceleration in m/s2

Q = flow rate in m3/s

t = time taken for flow in sec

H = height of flow in m

B) power required to run pump;

P = pgQH

Explanation:

Detailed explanation and calculation is shown in the image below

5 0
3 years ago
Other questions:
  • Estimate the theoretical fracture strength (in MPa) of a brittle material if it is known that fracture occurs by the propagation
    8·1 answer
  • What kind of value should an employee possess when employees are expected to be responsible and fair?
    5·1 answer
  • Earth whose in situ weight is 105lb/cf and whose compacted weight is 122 lb/cf is placed in a fill at the rate of 260 cy/hr, mea
    14·1 answer
  • Free ideas free points. You will be reported for answering "no" or I don't know
    11·1 answer
  • Estimate the time it would take for such axons to carry a message from a foot stepping on a sharp object to the brain and then b
    14·1 answer
  • What is the hardest part of thermodynamics?
    5·1 answer
  • Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    9·1 answer
  • 7. True or False? The positive effects of a new<br> technology always outweigh its negative effects.
    9·2 answers
  • Use the map to answer the question.
    12·1 answer
  • The locations and type of electrical device required on an architectural<br> plan are referred to as
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!