Lesson 28 of 62 ยท about 14 minutes
Reading and Writing Files ๐
Reading and Writing Files ๐ Real programs persist data. The with statement opens a file and closes it automatically, even if an error happens. with open("notes.txt", "w") as f: f.write("First line\n") f.write("Second line\n") with open("notes.txt") as f: #โฆ
The video for this lesson is out Friday 18 December at 6pm.
The video lesson is a free preview.
This lesson is part of Pythonaut Pro. The first two lessons are free, so you can start there and see how it works.