O'Reilly logo
  • You Wang thinks this is interesting:

Once a file is opened for reading in text mode, we can read the whole file into a single string using the file object’s read() method, or into a list of strings using the file object’s readlines() method.


Cover of Programming in Python 3: A Complete Introduction to the Python Language, Second Edition


read() returns a single string, readlines() returns a list of strings