book open('treasure txt'' 'n_chars for line in book number of characters on the line n_chars +len(lineincrease the count by that many print(n_charsbook close( we could measure the length of the line and increment the counter by the number of characters in the line to count the total number of characters in the file