What happens when you open an existing file with mode 'w' in Python?
Correct answer
A. Its content is erased
12 views
A. Its content is erased
12 views
'w' truncates the file to zero length.
Asked in: Python Interview File Handling
https://docs.python.org/3/tutorial/inputoutput.htmlNot sure why the answer is A? Ask here and get an explanation.