Need more help with file handling?
What’s an Investigate task?
In investigate tasks you are given some example code.
Underneath it are questions to make sure that you understand how the code works.
Use comments to answer the investigate questions on the example code.
Help! My code doesn’t work
Make sure that you check for the following things:
- Include the file extension (
.txt
) in the file name
- Use the exact same file variable with
open
and in the loop.
- Use exactly the same case in the filename.
- Indenting all the code that should be inside loops.
- Close the file once task is completed.