Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to add list item to text file python

your_list = [1,2,3,'test']

with open('your_text_file.txt', 'w') as f:
    for item in your_list:
        f.write(f"{line}
")

# text file
1
2
3
test
 
PREVIOUS NEXT
Tagged: #add #list #item #text #file #python
ADD COMMENT
Topic
Name
3+8 =