file_stats(path) returning a dict with keys lines, words, and chars — the classic wc utility. Words split on whitespace; chars count everything including newlines.file_stats('note.txt') # 'hi there\nbye\n'{'lines': 2, 'words': 3, 'chars': 13}Two lines, three words, thirteen characters.
Read the whole text, then derive all three numbers.
splitlines() for lines, split() for words, len() for chars.