Let suppose there is a file named "file1.txt", that contains following content,
This is line 1.
This is line 2.
This is line 3.
This is line 4.
This is line 5.
And, we are copying odd lines to another file named "file2.txt".
Example:
Input: "file1.txt"
This is line 1.
This is line 2.
This is line 3.
This is line 4.
This is line 5.
Output: "file2.txt"
This is line 2.
This is line 4.
Python program to copy odd lines of one file to another file
Output
need an explanation for this answer? contact us directly to get an explanation for this answer