Python--统计字符串中各字符的个数

1 #统计字符个数
2 str=input("请输入一串字符:")
3 resoult={}
4 for i in str:
5     resoult[i]=str.count(i)
6 print(resoult)

不得不惊叹Python内置函数的强悍

原文地址:https://www.cnblogs.com/Amen-Z/p/649703381Z.html