#并非转载和翻译,方法非原创,添加了注释而已
#并非转载和翻译,方法非原创,添加了注释而已
#并非转载和翻译,方法非原创,添加了注释而已
str = "sunck is a good man! sunck is a nice man! sunck is a handsome man! sunck is a good man! sunck is a nice man! sunck is a great man! sunck is a noble man! sunck is a cool man!"
word = input("输入要统计的单词,回车结束\n") #输入字符串以外的单词会报错,因为下面字典中只把字符串中存在的单词作为key
list = str.split(
Python:用字典统计字符串中某个单词出现次数
最新推荐文章于 2025-06-07 16:37:24 发布