treat it like list and it will behave like list list(file_objectlist of lines in the file book open('treasure txt'' 'lines list(bookprint(lines given that file is an iteratorwe can simply convert it into list and we get the list of lines