en_text = "The first step is one of awareness. It will be hard to make a change to positive thinking without being acutely intimate with the thoughts that run through your mind. Recently, I was amazed to discover deep buried emotions from negative thoughts that I had for fewer than 10 minutes. Without awareness, I would have carried the hurt and anger inside. Awareness helped me to bring them out to the open for me to deal with."
en_text = en_text.replace(',',' ').replace('.',' ')
text = en_text.split()
d = {}
for i in text:
for j in i[:1]:
if j in d:
d[j]+=1
else:
d[j]=1
print(d)
二、四、接上题,统计所有单词的首字母的出现次数
最新推荐文章于 2024-09-26 11:55:47 发布