Question:

Differentiate between 'w' and 'a' file modes in Python.

Show Hint

Updated On: Jan 21, 2025
Hide Solution
collegedunia
Verified By Collegedunia

Solution and Explanation

\[ \begin{array}{|c|c|} \hline \textbf{File Mode} & \textbf{Description} \\ \hline 'w' & Opens the file for writing. If the file exists, its content is erased. \\ 'a' & Opens the file for appending. Data is added to the end of the file. \\ \hline \end{array} \]

Was this answer helpful?
0
0