标签:lis print read 技术 for log get int tin
1.中软国际华南区技术总监曾老师还会来上两次课,同学们希望曾老师讲些什么内容?
2.中文分词
import jieba txt = open("快穿之天命贵女.txt","r",encoding=‘utf-8‘).read() a = jieba.cut(txt) counts = {} for b in a: if len(b) == 1: continue else: counts[b] = counts.get(b,0) + 1 items = list(counts.items()) items.sort(key=lambda x:x[1],reverse=True) for i in range(20): b,count = items[i] print("{0:<6}{1:>3}".format(b,count))
标签:lis print read 技术 for log get int tin
原文地址:http://www.cnblogs.com/chanzt/p/7593344.html