Answer the question
In order to leave comments, you need to log in
How to append data to a file from a new line in python?
Here, I want to append data to the file from a new line, here is my code:
for i in tem:
f.write(f"{i}"+"\n")
Answer the question
In order to leave comments, you need to log in
try opening the file as add instead of write. Or check the value of the variable i. Perhaps there is already a transfer
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question