Python collections.Counter() Class
The collections.Counter() class is a dict subclass for counting hashable objects.
Syntax
collections.Counter(iterable)
Return Value
A Counter object (dict subclass).
Example
Output
Click Run to execute your code