KnowledgeBoat Logo

Computer Science

Differentiate between readline() and readlines().

Python File Handling

1 Like

Answer

readline()readlines()
The readline() function reads from a file in read mode and returns the next line in the file or a blank string if there are no more lines.The readlines() function, also reads from a file in read mode and returns a list of all lines in the file.
The returned data is of string type.The returned data is of list type.

Answered By

1 Like


Related Questions