def counter ( items ) : results = { } for item in items : results [ item ] = results . get ( item , 0 ) + 1 return results
undefiened counter in python veribwl
Simplest required implementation of collections . Counter . Required as 2 . 6 does not have Counter in collections .
def counter(items):
    """
    Simplest required implementation of collections.Counter. Required as 2.6
    does not have Counter in collections.
    """
    results = {}
    for item in items:
        results[item] = results.get(item, 0) + 1
    return results