Cody Bable

Generation

generate functionSun, 23 Apr 2023

read from source file and write to target file line by line until the end of the source file. use a function to add the numbers in the source file and write to target file the sum.

def process(source, target): target.write(source.readline()) target.write(source.readline()) source = open('test.txt') target = open('target.txt') process(source, target)

Questions about programming?Chat with your personal AI assistant