what is the difference between readline() and readlines() function?
Answers
Answered by
20
HEY BUDDY ♥♥♥
HERE'S THE ANSWER ✌
⤵⤵⤵⤵⤵
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 returned data is of string type).
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 list type).
♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦
HOPE YOU FIND IT HELPFUL ☺☺☺
Answered by
6
Explanation:
readline() reads a single line from the file; a newline character (\n) is left at the end of the string, and is only omitted on the last line of the file if the file doesn't end in a newline. ... So the readlines uses the readline function to "read many times" the file.
Similar questions
English,
6 months ago
English,
6 months ago
Computer Science,
6 months ago
English,
1 year ago
Physics,
1 year ago
Social Sciences,
1 year ago