All file modes in Python
rfor readingwfor writingr+opens for reading and writing (cannot truncate a file)wfor writingw+for writing and reading (can truncate a file)rbfor reading a binary file. The file pointer is placed at the beginning of the file.rb+reading or writing a binary filewb+writing a binary filea+opens for appendingab+Opens a file for both appending and reading in binary. The file pointer is at the end of the file if the file exists. The file opens in the append mode.xopen for exclusive creation, failing if the file already exists (Python 3)