Q. What is the difference between read() and readlines() function?


Answer :-

The read() reads from a file in read mode, and stores its contents in a string type variable.

The readlines() function, reads from a file in read mode and returns a list of all lines in the file.

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post