Introduction
We open files to read or write data. Closing files saves changes and frees resources.
When you want to read data from a text file like a list of names.
When you want to save user input into a file for later use.
When you need to update or add information to an existing file.
When you want to process data stored in a file, like logs or reports.