Working with Files
Last updated
Last updated
Opening a file with Python we need to close it as well.
Instead, we can use a with
codeblock which will automatically handle closing the file once we're done with it.
We can read all lines of a file into a list for easy use. We need to strip the newline as well.