Instructions

  • 1. Your final score will reflect your grasp of the concepts—approach each question with precision.
  • 2. Thoroughly review each solution before proceeding to ensure full understanding.
  • 3. Final results will be available after submission to provide insights into areas for further improvement.
  • 4. Maintain academic integrity—plagiarism undermines learning and professional growth.
  • 5. Once submitted, responses are final, so ensure you’re confident in your answers.
  • 6. These challenges are designed to test practical knowledge; apply your skills as you would in real-world scenarios.

All Problems

Question

Action

Which mode is used to write binary data?

View

How do you open a binary file for reading?

View

What does the write() method return when writing binary data?

View

What method reads binary data from a file?

View

Which mode should be used to append binary data?

View

Which of the following reads a specific number of bytes from a binary file?

View

How do you read binary data line by line?

View

Which function converts binary data to string?

View

What encoding is used to convert binary to text?

View

What will happen if you write text data to a binary file?

View

Which mode is used to write binary data?

'wb'
'rb'
'w+'
'ab+'

How do you open a binary file for reading?

open('file', 'rb')
open('file', 'b')
open('file', 'wb')
open('file', 'br')

What does the write() method return when writing binary data?

Length of the data written
None
True or False
The file name

What method reads binary data from a file?

read()
read_binary()
readlines()
read(b)

Which mode should be used to append binary data?

'ab'
'wb'
'rb+'
'a'

Which of the following reads a specific number of bytes from a binary file?

read(5)
readbytes(5)
read_n(5)
readline(5)

How do you read binary data line by line?

readline()
for line in file:
Binary files cannot be read line by line
readlines()

Which function converts binary data to string?

decode()
encode()
bin_str()
bytes()

What encoding is used to convert binary to text?

UTF-8
ASCII
Binary Encoding
Hexadecimal

What will happen if you write text data to a binary file?

Data will be written without error
Encoding error may occur
File gets corrupted
Text data will be converted to bytes automatically