Question: what is the difference between a and w mode?
Answer: a: Opens a file for appending new information to it. The pointer is placed at the end of the file. A new file is created if one with the same name doesn't exist. w+: Opens a file for writing and reading.