Computer Science

To read the next line of the file from a file object fobj, we use:

  1. fobj.read(2)
  2. fobj.read()
  3. fobj.readline()
  4. fobj.readlines()

Python Data Handling

1 Like

Answer

fobj.readline()

Reason — The syntax to read a line in a file is <filehandle>.readline(). Hence according to this syntax fobj.readline() is correct format.

Answered By

2 Likes


Related Questions