根据列表的值来显示每一个元素出现的次数

lst = ['中雨','雷阵雨','中到大雨','','多云','','中雨']
dic = {}

for i in lst:
    if i not in dic:
        dic[i] = lst.count(i)

print(dic)

 


2020-05-24

posted @ 2020-05-24 17:09  CodeYaSuo  阅读(138)  评论(0编辑  收藏  举报