M

Mr. Dubey • 52.30K Points
Coach

Q. Correct syntax of file.readlines() is?

(A) fileobject.readlines( sizehint );
(B) fileobject.readlines();
(C) fileobject.readlines(sequence)
(D) none of the mentioned
Correct : Option (A)

Explanation:
 the method readlines() reads until eof using readline() and returns a list containing the lines. if the optional sizehint argument is present, instead of reading up to eof, whole lines totalling approximately sizehint bytes (possibly after rounding up to an internal buffer size) are read.

Share

Discusssion

Login to discuss.

Be the first to start discuss.