# How to keep old content when Writing to Files in Python # Python program to keep the old content of the file# when using write.  # Opening the file with append modefile = open("gfg input file.txt", "a")  # Content to be addedcontent = "\n\n# This Content is added through the program #"  # Writing the filefile.write(content)  # Closing the opened filefile.close()