le.
      </p>
      <p>
        - Use <code>'a'</code> mode if you want to add new content to an existing file without removing anything.
      </p>


      <h2>5. Handling Errors</h2>
      <p>
        What if the file doesn’t exist? Or you don’t have permission to open it? Python allows you to handle such errors
        using <code>try</code> and <code>except</code>.
      </p>
      <h3>Example: Handle Missing File Error</h3>
      <div class="code-block">
        <pre>
# Handle file errors
try:
   