字符统计
文章平均质量分 81
夏日清风有你
研究深度学习,类脑计算、高性能计算、云计算和边缘计算领域。
展开
-
Python 统计一个英文单词出现的频率
统计单词的个数 def count(str): count_words = str.split() count_word = {} for word in count_words: if word not in count_word.keys(): count_word[word] = 1 else: ...原创 2020-01-25 20:35:42 · 1380 阅读 · 3 评论 -
Python 统计一个英文字符串中每个字符出现的次数
Python 统计一个英文字符串中每个字符出现的次数 三种方法方法一定义字符串转化为list函数strchlsdef strchls (str): list = [] # 集合 i = 0 for w in str: # print(w) if w != ' ': list.append(w) retu......原创 2020-01-25 20:32:15 · 33556 阅读 · 2 评论