B4Coder
0%
LessonAbout 7 min

Chapter 12 · Lesson 2 of 5

02. Line by line, with with

with open() closes the file for you. Loop over the file to get one line at a time, and strip() the new line off the end.

Opening the lesson…