Question:

Which of the following represents the mode of both writing and reading in binary format in a file?

Show Hint

To work with binary files in Python, use modes like 'wb', 'rb', 'wb+', etc., where 'b' indicates binary mode and '+' allows both reading and writing.
Updated On: Apr 24, 2025
  • wb+
  • w
  • a+
  • w+
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

In Python, the mode 'wb+' is used to open a file for both reading and writing in binary format. Here:
- 'w' stands for writing mode.
- 'b' stands for binary format.
- '+' indicates that the file is opened for both reading and writing.
Therefore, the correct answer is 'wb+'.
Was this answer helpful?
0
0