统计字符串里每一个字符的个数

统计字符串里每一个字符的个数 方法一: str = "hello world" from collections import Counter print(Counter(str)) 方法二: str = "hello world" new_list=[] # 字符串变列表 mylist = str.split() # 列表变字符串 mystr = "".join(mylist) print(
相关文章
相关标签/搜索