ine of text
file.close()  # Always close the file when done
  </pre>
      </div>
      <h3>Output in the file:</h3>
      <pre>
Hello, Python learners!
File handling is easy to learn.
</pre>
      <p>
        <strong>Explanation:</strong>
      </p>
      <ul>
        <li>We opened the file <code>example.txt</code> in <code>'w'</code> mode, which means we are writing to it. If
          the file already exists, it will be completely replaced with the new content.</li>
        <li><code>write()</code> write