Ask Question
27 January, 21:43

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. 28 January, 00:19
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers