A dictionary (map, associative array) stores key → value associations, letting you look up a value by its key in average O(1). A set is essentially a map with keys but no values — it stores membership only.
Example
python
text = .split()
counts = {}
word text:
counts[word] = counts.get(word, ) +
ages = {: , : }
ages[]
ages[] =
ages
