and print its contents to the screen. ::
for line in open("myfile.txt"):
The problem with this code is that it leaves the file open for an indeterminate
amount of time after this part of the code has finished executing.
with open("myfile.txt") as f:
After the statement is executed, the file *f* is always closed, even if a
problem was encountered while processing the lines. Objects which, like files,