When working with large files, why might the readlines() method not be the most memory-efficient?

  • It doesn't work with large files
  • It lacks support for binary file formats
  • It reads the entire file into memory
  • It's not available in Python
The 'readlines()' method reads the entire file into memory, which can be inefficient for large files, as it can lead to memory consumption issues. It's better to use methods like 'readline()' or iterate over the file to process it line by line.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *