To write to an existing file, we must add a mode as parameter to the open () function: "a" - append - will append to the end of the file, if the file does not exist it creates a new file. "w" - write ...