Computer Science

Differentiate between readline() and readlines().

Python File Handling

16 Likes

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

8 Likes


Related Questions