Welcome to StackOverflow!
You have the right idea, let's start by opening some files.
with open("text.txt", "r") as filestream:
with open("answers.txt", "w") as filestreamtwo:
: text.txt answer.txt.
"", , , , .
"text.txt" .
for line in filestream:
for .
, , !
currentline = line.split(",")
"currentline" , "text.txt".
.
total = str(int(currentline[0]) + int(currentline[1]) + int(currentline [2])) + "\n"
int "currentline". !
"\n", "answer.txt" .
filestreamtwo.write(total)
"answer.txt"... ! !
:
with open("test.txt", "r") as filestream:
with open("answers.txt", "w") as filestreamtwo:
for line in filestream:
currentline = line.split(",")
total = str(int(currentline[0]) + int(currentline[1]) + int(currentline [2])) + "\n"
filestreamtwo.write(total)