book open('treasure txt'' 'n_lines line count for line in book read each line of the file n_lines + print(n_linesbook close(increment the count print out the count for examplewe could just increment counter for each line to count the number of lines