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
Describe, in a general form, the equation, in time domain, that tells the voltage across a inductor, L, as a function of time wh
love history [14]

Answer:

a) V(t) = Ldi(t)/dt

b) If current is constant, V = 0

Explanation:

a) The voltage, V(t), across an inductor is proportional to the rate of change of the current flowing across it with time.

If  V represents the Voltage across the inductor

and i(t) represents the current across the inductor in time, t.

V(t) ∝ di(t)/dt

Introducing a proportionality constant,L, which is the inductance of the inductor

The general equation describing the voltage across the inductor of inductance, L, as a function of time when a current flows through it is shown below.

V(t) = Ldi(t)/dt ..................................................(1)

b) If the current flowing through the inductor is constant i.e. does not vary with time

di(t)/dt = 0   and hence the general equation (1) above becomes

V(t) = 0

4 0
4 years ago
How do Consumers sometimes interact with a producers?
Vika [28.1K]
I really don’t know good luck
7 0
3 years ago
A pinion and gear pair is used to transmit a power of 5000 W. The teeth numbers of pinion
tester [92]

Answer:

mark me as a brainleast

Explanation:

209781

6 0
3 years ago
Five kilograms of air at 427°C and 600 kPa are contained in a piston–cylinder device. The air expands adiabatically until the pr
son4ous [18]

Answer:

The entropy change of the air is 0.240kJ/kgK

Explanation:

T_{1} =427+273K,T_{1} =700K\\P_{1} =600kPa\\P_{2} =100kPa

T_{2}  is unknown

we can apply the following expression to find T_{2}

-w_{out} =mc_{v} (T_{2} -T_{1} )

T_{2} =T_{1} -\frac{w_{out } }{mc_{v} }

now substitute

T_{2} =700K-\frac{600kJ}{5kg*0.718kJ/kgK} \\T_{2}=533K

To find entropy change of the air we can apply the ideal gas relationship

Δs_{air}=c_{p} ln\frac{T_{2} }{T_{1} } -Rln\frac{P_{2} }{P_{1} }

Δs_{air} =1.005*ln(\frac{533}{700})-0.287* in(\frac{100}{600} )

Δs_{air} =0.240kJ/kgK

4 0
3 years ago
Q2) An engineer borrowed $3000 from the bank, payable in six equal end-of-year payments at 8%. The bank agreed to reduce the int
tatyana61 [14]
Answer is: $637.28; just did the math but i really don’t want to type it all out.
6 0
3 years ago
Other questions:
  • Two Technicians are discussing shock absorbers. Technician A says most shock absorbers help support vehicle weight. Technician B
    5·1 answer
  • Consider a CMOS inverter which has ideal transistors with the following characteristics: PMOS transistor: W/L = 2; Mobility (up)
    13·1 answer
  • A bolt is tightened, subjecting its shank to a tensile stress of 80 kpsi and a torsional shear stress of 50 kpsi at a critical p
    7·1 answer
  • A water contains 50.40 mg/L as CaCO3 of carbon dioxide, 190.00 mg/L as CaCO3 of Ca2 and 55.00 mg/L as CaCO3 of Mg2 . All of the
    5·2 answers
  • 1) Each of the following would be considered company-confidential except
    10·1 answer
  • A student lives in an apartment with a floor area of 60 m2 and ceiling height of 1.8 m. The apartment has a fresh (outdoor) air
    14·1 answer
  • If you’re still enrolled in school, but are looking for a job, on your resume you should highlight:
    15·1 answer
  • Use the drop-down menus to complete the statements about using OneNote in Outlook meeting requests.
    15·1 answer
  • As you have learned, not all motor oils are the same. What are two things that make them different?.
    11·1 answer
  • A bridge a mass of 800 kg and is able to support up to 4 560 kg. What is its structural efficiency?
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!