outputjust as you've been doing with terminal-based output appending to file if you want to add content to file instead of writing over existing contentyou can open the file in append mode when you open file in append modepython doesn' erase the file before returning the file object any lines you write to the file will be added at the end of the file if the file doesn' exist yetpython will create an empty file for you let' modify write_message py by adding some new reasons we love programming to the existing file programming txtwrite_ message py filename 'programming txtu with open(filename' 'as file_objectv file_object write(" also love finding meaning in large datasets \ "file_object write(" love creating apps that can run in browser \ "at we use the 'aargument to open the file for appending rather than writing over the existing file at we write two new lineswhich are added to programming txtprogramming txt love programming love creating new games also love finding meaning in large datasets love creating apps that can run in browser we end up with the original contents of the filefollowed by the new content we just added try it yourse lf - guestwrite program that prompts the user for their name when they respondwrite their name to file called guest txt - guest bookwrite while loop that prompts users for their name when they enter their nameprint greeting to the screen and add line recording their visit in file called guest_book txt make sure each entry appears on new line in the file - programming pollwrite while loop that asks people why they like programming each time someone enters reasonadd their reason to file that stores all the responses files and exceptions