I made an online survey and I keep track of all the inputs in a txt file.
Below are two questions, and everytime someone answers a question, I want to append the answer to the coresponding question.
This is all i have in my txt file so far:
0, On a scale of 1-5, how are you feeling today?,3,5,4,5,4,3,
1, What activites can improve your mood?,eat,sleep,drink,talk,tv,
My question is : How can i use python to append a data into the first line of the file instead of the second?
Like if i do:
f= open ('results.txt','a')
f.write ('5')
f.close ()
it will append '5' to the second line, but I want that result to be adde onto the first question.