preview_and_count(path, n) that reads the first n characters of a file, then rewinds with seek(0) and counts the total characters — returning the tuple (preview, total_chars) from a single open.preview_and_count('note.txt', 5) # content: 'hello world'('hello', 11)Five preview chars; eleven total after rewinding.
read(n) advances the position by n.
seek(0) returns to the start; len(read()) counts the rest.