Which lines would you use?

You are going to read 16 bytes from a binary file into a bytearray called data .

Which lines would you use?
A . data = bytearray (16) bf.readinto (data)
B . data = binfile.read (bytearray (16))
C . bf. readinto (data = bytearray (16))
D . data = bytearray (binfile.read (16))

Answer: D

Explanation:

https://docs.python.org/3/library/functions.html#func-bytearray https://docs.python.org/3/library/io.html

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments