from collections import defaultdict,Counter
-------------1
dd=defaultdict(int)
for item in names:
dd[item]+=1
for k,v in dd.iteritems():
pass
-------------2
for item in set(names):
a=names.count(item)
-------------3
c=Counter(names)
for k,v in dict(c).iteritems():
pass
1、3差不多,2最慢