Ask Question
14 November, 17:38

Write a program that will open a file named thisFile. txt and write every other line into the file thatFile. txt. Assume the input file (thisFile. txt) resides in the same directory as your code file, and that your output file (thatFile. txt) will reside in the same location. Do not attempt to read from or write to other locations.

+1
Answers (1)
  1. 14 November, 18:25
    0
    Check the explanation

    Explanation:

    The programmable code to solve the question above will be written in a python programming language (which is a high-level, interpreted, general-purpose programming language.)

    f = open ('thisFile. txt', 'r')

    w = open ('thatFile. txt', 'w')

    count = 0

    for line in f:

    if count % 2 = = 0:

    w. write (line)

    count + = 1

    w. close ()

    f. close ()
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write a program that will open a file named thisFile. txt and write every other line into the file thatFile. txt. Assume the input file ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers