Vidyalelo
Python · Q58

Files Handling in Python

Programming · Python · question 58

Q58

What is the output of the following code:with open('data.txt', 'r') as file: content = file.read(10)print(content)

A.
The first 10 characters of data.txt
Answer
B.
An error will occur
C.
The content of data.txt
D.
The file object file

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board