字符串-统计个数2
3、统计列表英文字母的单词个数
d = ["a","uhhj","jlkjn",,"jlkjn"]
方法一:
data = list(set(d))
dictcount = {}
for i in data:
dictcount[i]=d.count(i)
方法二:
dictcount = {}
for i in d:
if i not in dictcount.keys():
dictcount[i]=1
else:
dictcount[i] +=1
print(dictcount)
上班求生存,下班求发展