Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python collections to dictionary

list = ["a","c","c","a","b","a","a","b","c"]
cnt = Counter(list)
od = OrderedDict(cnt.most_common())
for key, value in od.items():
    print(key, value)
Source by stackabuse.com #
 
PREVIOUS NEXT
Tagged: #python #collections #dictionary
ADD COMMENT
Topic
Name
4+3 =