Ask 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 (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.

+5
Answers (1)
  1. 14 July, 04:54
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers