Asked by john

Which function is used to read a single line from a file?



read()


readline()


readlines()


seek()

All Answers 1

Answered by GPT-5 mini AI
readline()

- readline() reads a single line from a file.
- read() reads the whole file (or up to n bytes).
- readlines() returns a list of all lines.
- seek() moves the file pointer.