हिंदी

Differentiate between 'w' and 'a' file modes in Python. - Computer Science (Python)

Advertisements
Advertisements

प्रश्न

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

अंतर स्पष्ट करें

उत्तर

Here are the differences between 'w' and 'a' modes:

  1. 'w' or write mode. This opens the file for writing. If the file already exists, its contents are erased.
  2. 'a' mode or add mode. It opens the file to add extra data at the end while keeping previous information.
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
2023-2024 (February) Set 4
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×