txt</code> without losing the existing text.
        Here's how you do it:
      </p>
      <div class="code-block">
        <pre>
# Example: Add more data to an existing file
file = open("example.txt", "a")  # 'a' mode opens the file for appending (doesn't erase existing content)
file.write("\nThis line is added to the file.")  # Append a new line of text
file.close()  # Always close the file when done
  </pre>
      </div>
      <h3>Output in the file:</h3>
      <pre>
Hello, Python learners!
File handlin