So i have made the code and it all checks out but when i run it, you would have to create your own text file, i get the random output of (1, '\n'). I cant explain it properly because im quite new so i hope the code helps.
I have got what i expected to happen however at the end of every line that is printed to the user, the annoying (1,'\n') appears as well.