Vidyalelo
Python · Q7

Files Handling in Python

Programming · Python · question 7

Q7

How can you read the entire contents of a file line by line in Python?

A.
By using a for loop with the file object
B.
By using the readlines() method on a file object
Answer
C.
By using the readline() method on a file object
D.
By using the line() function

Answer: Option B

Solution

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