【Python】使用Counter方法統計字符串每一個字符出現的次數

from collections import Counter a = "a;lskdh!`foiegn``as;ldnf,asd.121,2ljladsfkja`sdijfhaosjlfd,gjsdfg.as.dl" b = Counter(a) print(b) ------------------------------- Counter({'s': 8, 'd': 8, 'a': 7,
相關文章
相關標籤/搜索