Correct syntax of file.readlines() is? A. fileObject.readlines(

correct-syntax-of-file-readlines-is-a-fileobject-readlines

Correct syntax of file.readlines() is?

A. fileObject.readlines( sizehint );

B. fileObject.readlines();

C. fileObject.readlines(sequence)

D. none of the mentioned

I got this question by my school principal while I was bunking the class.

I want to ask this question from Files in division Regular Expressions and Files of Python

The correct answer is A. fileObject.readlines( sizehint );

The best I can explain: 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.

Syntax

Following is the syntax for readlines() method:

fileObject.readlines( sizehint );

Parameters

sizehint — This is the number of bytes to be read from the file.