Code Demo · Python · Simple Text Parser

python-3
from collections import Counter
import re

text = "Debug small ideas, inspect the output, and share the result."
words = re.findall(r"[a-z]+", text.lower())
print({"words": len(words), "unique": len(set(words)), "top": Counter(words).most_common(3)})
250 characters6 lines< 750 B