标签:item rip for import ems python实现 lang xtend ffd
lst = []
from collections import Counter
l = [‘fa|aaaa|fsjkedf|\n‘, ‘sdaffs|asdffdsa|0|0|||a1|a1|a1|\n‘]
for i in l:
lst.extend(i.strip(‘\n‘).split(‘|‘))
# print(ls)
d2 = Counter(lst)
# print(d2.items())
sorted_x = sorted(d2.items(), key=lambda x: x[1],reverse=True)
print(sorted_x)
for i in sorted_x:
print(i[0],i[1])
标签:item rip for import ems python实现 lang xtend ffd
原文地址:https://www.cnblogs.com/hanfe1/p/13968154.html