Question: what is the difference between opening a file in w+ and a+ mode?
Answer: w+ : Opens a file for writing and reading. ... A new file is created if one with the same name doesn't exist. ab : Opens a file for appending in binary mode. a+ : Opens a file for both appending and reading.