Python Programming - Reading and Writing Files - Discussion

Discussion Forum : Reading and Writing Files - General Questions (Q.No. 22)
22.
How can you read the content of a binary file named "binary_data.dat"?
content = open("binary_data.dat").read()
content = open("binary_data.dat", "rb").read()
content = read_binary("binary_data.dat")
content = open_binary("binary_data.dat").read()
Answer: Option
Explanation:
To read the content of a binary file, the file should be opened with mode "rb".
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.