Question: Write a function named retain _ every _ other _ line that has two parameters: the name of an input file and the name of

Write a function named retain_every_other_line that has two
parameters: the name of an input file and the name of an output file. The function should
write every other line of the input file to the output file. For example, if the input file contains
five lines, the output file should end up with three separate lines: the first line of the input file,
the third line of the input file and the fifth line of the input file.
You may assume that the input file exists. Here is a sample call to the function:
retain_every_other_line("input.txt", "output.txt")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!