Answers for "python collections to dictionary"

0

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)
Posted by: Guest on May-23-2020

Python Answers by Framework

Browse Popular Code Answers by Language