Computer Science
The readlines() method returns
- str
- a list of lines
- a list of single characters
- a list of integers
Python File Handling
3 Likes
Answer
a list of lines
Reason — The readlines() method returns the entire file content in a list where each line is one item of the list.
Answered By
2 Likes
Related Questions
To read the next line of the file from a file object infi, we use
- infi.read(all)
- infi.read()
- infi.readline()
- infi.readlines()
To read the remaining lines of the file from a file object infi, we use
- infi.read(all)
- infi.read()
- infi.readline()
- infi.readlines()
Which of the following mode will refer to binary data ?
- r
- w
- +
- b
Which of the following statement is not correct ?
- We can write content into a text file opened using 'w' mode.
- We can write content into a text file opened using 'w+' mode.
- We can write content into a text file opened using 'r' mode.
- We can write content into a text file opened using 'r+' mode.