Modes of opening files in Python:
r - Opens a file for reading only. The file pointer is placed at the beginning of the file. This is the default mode.
w - Opens a file for writing only. Overwrites the file if the file exists. If the file does not exist, creates a new file for writing.
a - Opens a file for appending. The file pointer is at the end of the file if the file exists. That is, the file is in the append mode. If the file does not exist, it creates a new file for writing.
rb - Opens a file for reading only in binary format. The file pointer is placed at the beginning of the file. This is the default mode.
a+ - Opens a file for both appending and reading. The file pointer is at the end of the file if the file exists. The file opens in the append mode. If the file does not exist, it creates a new file for reading and writing.
Python for Absolute Beginners Playlist: https://www.youtube.com/playlist?list...
Connect with me:
LinkedIn
Facebook
Github
Instagram