Computer Science

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

  1. infi.read(all)
  2. infi.read()
  3. infi.readline()
  4. infi.readlines()

Python File Handling

2 Likes

Answer

infi.readline()

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

Answered By

1 Like


Related Questions