Discuss various modes to open a file.
Question :
Discuss various modes to open a file.
'r' : This mode indicates that file will be open for reading only.
'w' : This mode indicates that file will be open for writing only. If file, does not exists, it will create a new one.
'a' : This mode indicates that the output of that program will be append to the previous output of the file.
'r+' : This mode indicates that file will be open for both reading and writing.