Close
Lesson 9 of 12 in Coddy's File Handling in Python course.
It's a good practice to close the files you open, using close().
f = open('a.txt')
f.close()Or it can be also done by using with in Python,
with open('a.txt') as f:
# preform operations on fUsing with keyword eliminates the need to close the file as it does it for you!
Try it yourself
This lesson doesn't include a code challenge.