Which file mode in Python allows appending to a file in binary format?
- 'a'
- 'a+'
- 'ab'
- 'rb+'
The 'ab' file mode allows appending to a file in binary format. When you open a file in 'ab' mode, data is written in binary, making it suitable for binary file types like images or non-text data.
Loading...
Related Quiz
- What is the primary difference between a class attribute and an instance attribute in Python?
- In pytest, the ____ marker is used to skip a test function under certain conditions.
- What would be the best sorting algorithm to use if you are concerned about worst-case time complexity?
- A decorator in Python is a design pattern used to add new functionality to an object without altering its ____.
- Which of the following data structures is best suited for a First In First Out (FIFO) approach?