Computer Science
The readlines() method returns:
- String
- A list of integers
- A list of single characters
- A list of strings
Python Data Handling
2 Likes
Answer
A list of strings
Reason — The readlines() method reads all lines from the file into a list and returns a list of strings, where each string represents a line from the file, separated by the new line character '\n'.
Answered By
1 Like
Related Questions
To read the next line of the file from a file object fobj, we use:
- fobj.read(2)
- fobj.read()
- fobj.readline()
- fobj.readlines()
To read the remaining lines of the file from a file object fobj, we use:
- fobj.read(2)
- fobj.read()
- fobj readline()
- fobj.readlines()
Which module is required to use the built-in function dump()?
- math
- flush
- pickle
- unpickle
Which of the following functions is used to write data in the binary mode?
- write
- output
- dump
- send