#Author: James Tam #Version: October 28, 2024 #Learning objective: #*Opening a file for writing. #*Writing a single line to a file. #Opens the file for writing #If file already exists: previous text is overwritten with the text below #If file doesn't exist: creates a new file with the text in the call to write. aFile = open("example1_output.txt","w") aFile.write("line1\nline2") aFile.close()