Build a vocabulary table
P42.from-paper-to-notebook.02 · Audience: Guest, Language professional, IT/ML learner · Prerequisites: Tally the words in a text
Where next?
Later in From Paper to Notebook
P42.from-paper-to-notebook.02 · Audience: Guest, Language professional, IT/ML learner · Prerequisites: Tally the words in a text
Later in From Paper to Notebook
An interpreter builds a glossary: jot down every specialist term, drop the
repeats, put them in order. Done by hand it is fiddly — you cross out the same
word twice, lose your alphabetical place, miss one. Two small tools do the whole
clean-up for you: a set removes duplicates, and sorted puts what is
left in order.
set(...) throws away the repeats and keeps one of each. To de-duplicate a list of terms and read them back in a fixed order, sort the set:UNIQUE = sorted(set(terms))Why it matters — De-duplicating by hand is exactly where a glossary goes wrong — the same term written twice, slightly differently. A set does it perfectly, every time.
Ask a question about this content. The mentor explains and grounds its answer in what you are studying; asking is recorded as a learning signal, not a grade.
Off by default. The mentor always gets your file; this only decides whether your own copy stays here. Copies live in this browser only - they do not follow you to another device, and clearing site data removes them.
Your turn: de-duplicate and sort the terms, then loop to build a vocabulary table pairing each term with its length. Press Run.
Loading exercise…
Loading your notes...