Question: what is the difference between w and a modes in python?
Answer: r+ : Opens a file for reading and writing, placing the pointer at the beginning of the file. w : Opens in write-only mode. The pointer is placed at the beginning of the file and this will overwrite any existing file with the same name. It will create a new file if one with the same name doesn't exist.