To add on to @math2001's answer, you could do something like this:
numOfFiles = #int
data = []
for files in range(1, numOfFiles+1):
with open(str(files), 'r') as f:
// do whatever data processing you need to do
fileData = f.read()
data.append(fileData)
target_file = open(final_file_name, "rt") target_file.close()