o open a file
with open("example.txt", "r") as file:
    content = file.read()  # Read the file
    print(content)  # Print the content
# No need to call file.close(); it’s done automatically
  </pre>
      </div>
      <p>
        Using <code>with</code> is safer and more efficient because Python handles closing the file for you.
      </p>


      <h2>2. Reading from a File</h2>
      <p>Python provides multiple ways to read data:</p>
      <ul>
        <li><strong><code>read()</code></strong>: Reads al