Advertisements
Advertisements
प्रश्न
Differentiate between r+ and w+ file modes in Python.
फरक स्पष्ट करा
उत्तर
r+ mode:
- Primary function is reading.
- File pointer is at beginning of file.
- if the file does not exist, it results in an error.
w+ mode:
- primary function is writing.
- If the file does not exist, it creates a new file.
- If the file exists, previous data is overwritten.
- File pointer is at the beginning of file.
shaalaa.com
Text File Open Modes
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?