摘要: def printIntro(): print("这个程序模拟两个选手A和B的乒乓球比赛") print("程序运行需要A和B的能力值(以0到1之间的小数表示)") #获得程序运行参数def printInputs(): a = eval(input("请输入选手A的能力值(0-1): ")) b 阅读全文
posted @ 2021-11-13 23:17 徐韵晴 阅读(38) 评论(0) 推荐(0)
摘要: import jieba txt = open("D:\\西游记.txt", "r", encoding='gb18030').read()words = jieba.lcut(txt) # 使用精确模式对文本进行分词counts = {} # 通过键值对的形式存储词语及其出现的次数 for wor 阅读全文
posted @ 2021-11-13 23:15 徐韵晴 阅读(83) 评论(0) 推荐(0)