- 博客(1)
- 收藏
- 关注
原创 Python实现统计文本中各单词数量
Python实现统计文本中各单词数量代码运行结果代码```pythonimport strings = 'not talk,not helo show me your code hello helo'for i in s: '''变例s中的字符,如果属于标点符号则替换成空格''' if i in string.punctuation: s = s.replace(i, ' ')# print(s)lst = s.split()# s被空格分割形成的列表传给
2021-09-30 15:11:01
4730
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人