CBSE Class 12 Computer Science Question 45 of 145

File Handling — Question 6

Back to all questions
6
Question

Question 6

The readlines() method returns

  1. str
  2. a list of lines
  3. a list of single characters
  4. a list of integers
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.