subject

Write a function named clonelines that takes two parameters:

1. infile, a string, the name of an input file that exists before clonelines is called
2. outfile, a string, the name of an output file that clonelines creates and writes to

the function clonelines reads the content of infile, line by line, and writes into outfile any line that contains at least one word that occurs more than once on the line. you may assume that the input file contains only lowercase letters, spaces and newline characters.

for example, if the following is the content of the file william. txt:

double double toil and trouble fire burn and caldron bubble

eye of newt and toe of frog fillet of a fenny snake in the caldron boil and bake

double double toil and trouble fire burn and caldron bubble

the following function call:

> > > infile = 'william. txt'

> > > outfile = 'clones. txt'

> > > clonelines (infile, outfile)

should create the file clones. txt with the content:

double double toil and trouble eye of newt and toe of frog double double toil and trouble

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:20
The kurt vonnegut commencement speech, the neiman-marcus chocolate chip cookie recipe, and the get-well emails to the dying boy are examples of select one: a. social engineering b. hoax emails c. email viruses d. worms
Answers: 1
question
Computers and Technology, 22.06.2019 13:50
The instruction ishl (shift left integer) exists in jvm but not in ijvm. it uses the top two values on the stack, replacing the two with a single value, the result. the sec- ond-from-top word of the stack is the operand to be shifted. its content is shifted left by a value between 0 and 31, inclusive, depending on the value of the 5 least signifi- cant bits of the top word on the stack (the other 27 bits of the top word are ignored). zeros are shifted in from the right for as many bits as the shift count. the opcode for ishl is 120 (0x78).a. what is the arithmetic operation equivalent to shifting left with a count of 2? b. extend the microcode to include this instruction as a part of ijv.
Answers: 1
question
Computers and Technology, 23.06.2019 06:30
How do you write an argumentative essay about the importance of free enterprise ?
Answers: 1
question
Computers and Technology, 24.06.2019 00:50
Which of the following is not a key player in the sale of travel products?
Answers: 2
You know the right answer?
Write a function named clonelines that takes two parameters:

1. infile, a string, the...
Questions
question
Mathematics, 07.12.2021 01:00
question
Mathematics, 07.12.2021 01:00
question
Spanish, 07.12.2021 01:00
question
Mathematics, 07.12.2021 01:00
Questions on the website: 13722362