OnlinePython

Reading Files Exercise

Question 1 of 4

Which method is most memory-efficient for processing a very large file line by line?

# Processing a 2GB log file
with open("large_log.txt", "r") as file:
    # Which approach uses the least memory?
    pass