Summary

Completed

In this module, you learned how to move data between your Python programs and the file system.

You used the with statement to open files safely and let Python close them automatically. You read data using .read(), .readlines(), and line-by-line iteration, and chose the right approach for the situation. You wrote data using write mode when you wanted a fresh file, and append mode when you wanted to add to what was already there. Finally, you built a to-do list app that remembers tasks between runs.

Tip

To continue learning Python, move on to the next module: Write reusable code.