When reading a file in text mode in Python, what does the file method readline() return?

  • A boolean indicating EOF
  • A line of text
  • A list of lines in the file
  • The entire file contents
In Python, when you use the readline() method in text mode, it returns a line of text from the file, up to and including the newline character 'n'.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *