Does readlines() return a list or an iterator in Python 3?
The readlines method doesn’t return an iterator in Python 3, it returns a list Help on built-in function readlines: readlines(…) Return a list of lines from the stream. To check, just call it from an interactive session – it will return a list, rather than an iterator: >>> type(f.readlines()) <class ‘list’> Dive into Python appears … Read more