๐Ÿ“– Beginning Python Programming /
Module: Files Operation

More file object operation

๐Ÿ“– Beginning Python Programming / Files Operation / More file object operation

Writing a list into file with line endings

list = ["Susan", "Chris", "Anthony", "Joana"]
with open("guests3.txt", "a") as file_obj:        
    file_obj.write( "\n".join(list) )