CBSE Class 12 Computer Science Question 45 of 136

Data File Handling — Question 10

Back to all questions
10
Question

Question 10

The readlines() method returns:

  1. String
  2. A list of integers
  3. A list of single characters
  4. A list of strings
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'.