Access contents of list after applying Counter from collections module

The Counter object is a sub-class of a dictionary.

A Counter is a dict subclass for counting hashable objects. It is an unordered collection where elements are stored as dictionary keys and their counts are stored as dictionary values.

You can access the elements the same way you would another dictionary:

>>> from collections import Counter
>>> theList = ['blue', 'red', 'blue', 'yellow', 'blue', 'red']
>>> newList = Counter(theList)
>>> newList['blue']
3

If you want to print the keys and values you can do this:

>>> for k,v in newList.items():
...     print(k,v)
...
blue 3
yellow 1
red 2