Write Strings to File in Append Mode
Write strings to file in append mode¶ Let us see how we can write multiple strings from a list to file in append mode. We cannot write the list of strings into file properly all at once. In [1]: departments = [ ‘2,Fitness’, ‘3,Footwear’, ‘4,Apparel’, ‘5,Golf’, ‘6,Outdoors’, ‘7,Fan Shop’ ] In [2]: file = open(‘data/departments.txt’, ‘w’) In [3]: …