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
DUE AT 3:00!!!!!
emmainna [20.7K]
It is heat because that is what made the tires lose air
5 0
3 years ago
Read 2 more answers
How do you make coke for steel?
stich3 [128]
Can you be a bit more specific plz and that will let me identify the answer
6 0
3 years ago
Concerned with the number of maintenance visits the rocket can undergo before being out of service, you have been informed that
Ainat [17]

Answer:

(a) Mn = M₁ + (n-1) (M₂ -M₁) = 1 + (n- 1) 1 = n (b) n > 10 (exceed 10) or n =11 (c) n >50 or n= 51

After making a journey of 51 times, the rocket will be discarded

Explanation:

Solution

(a) Let Mn denotes the number of  maintenance visits after the nth journey

Then M₁ = 1 , M₂ = 1 +M₁ = 2, M₃ = 1 +M₂ = 3

We therefore, notice that M follows an arithmetic sequence

So,

Mn = M₁ + (n-1) (M₂ -M₁)

= 1 + (n- 1) 1 = n

or Mn =n

(b)  For what value of n we will get  fro Mn > 10

Thus,

n > 10 (exceed 10) or n =11

(c)Similarly of Mn is greater than 50 or Mn>50, the rocket will not be used or reused

So,

n >50 or n= 51

After making a journey of 51 times, the rocket will be discarded

7 0
3 years ago
Which of the following is not a relationship set between elements in a sketch​
Svet_ta [14]

Answer:

The entity relationship (ER) data model has existed for over 35 years. It is well suited to data modelling for use with databases because it is fairly abstract and is easy to discuss and explain. ER models are readily translated to relations. ER models, also called an ER schema, are represented by ER diagrams.

6 0
2 years ago
For a steel alloy it has been determined that a carburizing heat treatment of 11-h duration will raise the carbon concentration
Jobisdone [24]

Answer:

Time =t2=58.4 h

Explanation:

Since temperature is the same hence using condition

x^2/Dt=constant

where t is the time as temperature so D also remains constant

hence

x^2/t=constant

2.3^2/11=5.3^2/t2

time=t^2=58.4 h

4 0
3 years ago
Other questions:
  • Which statement about direct-mail messages is most accurate? Group of answer choices Direct mail is an effective channel for per
    15·1 answer
  • Estimate the daily carbon utilization to remove chlorobenzene from 1.0 MGD of ground water saturated with chlorobenzene. Assume
    12·1 answer
  • What is 29*69+98-78/36=
    9·2 answers
  • What is a quasi-equilibrium process? What is its importance in engineering?
    14·1 answer
  • What is the base unit in standard measurement
    13·2 answers
  • Complete the following sentence. Engineers explore biology, chemistry, and physics for use in scenarios.
    8·2 answers
  • A 5-mm-thick stainless steel strip (k = 21 W/m•K, rho = 8000 kg/m3, and cp = 570 J/kg•K) is being heat treated as it moves throu
    6·1 answer
  • The air loss rate for a straight truck or bus with the engine off and the brakes
    11·1 answer
  • What is the angle of the input
    12·1 answer
  • In a series circuit, resistance is the simple _____ of all resistors in the circuit.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!