File handle python

whats the difference between r+ and w+…?

and if something is already in a text file and we do r+ and write something will overwrite or append?

hi @sahil.kalamkar
w+ truncate the file to zero length if it exists or create a new file if it doesn’t. While r+ neither deletes the content nor create a new file if it doesn’t exist.