>>> from collections import Counter >>> x = Counter("balloon") >>> x Counter({'o': 2, 'a': 1, 'b': 1, 'l': 2, 'n': 1}) >>> x['o'] 2