摘要: 英文通过空格分割,中文使用jieba分词并加载停用词表 二、中文分词 1.准备utf-8编码的文本文件file 2.通过文件读取字符串 str 3.对文本进行预处理 4.分解提取单词 list 5.单词计数字典 set , dict 6.按词频排序 list.sort(key=) 7.排除语法型词汇 阅读全文
posted @ 2018-10-15 10:46 dafeifeifei 阅读(308) 评论(0) 推荐(0) 编辑
摘要: 2、 对taylor歌词进行分词 阅读全文
posted @ 2018-10-08 09:07 dafeifeifei 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 1、输入1表示摄氏温度,2表示华摄氏度 2、while True:循环,多次判断 3、if判断是什么温度 运行结果: 二、猜数字小游戏 1、random模块随机生成0-100数字 2、while实现判断 运行结果: 三、解析身份证 1、输入身份证,判断是不是18位,不是重新输入 2、通过字符串切片解 阅读全文
posted @ 2018-09-10 08:47 dafeifeifei 阅读(143) 评论(0) 推荐(0) 编辑
摘要: For example, two is written as II in Roman numeral, just two one's added together. Twelve is written as, XII, which is simply X + II. The number twent 阅读全文
posted @ 2018-09-06 18:58 dafeifeifei 阅读(70) 评论(0) 推荐(0) 编辑
摘要: 练习一 1、定义主函数main() 实现输入名字,通过format格式化字符串 2、运行main() 运行截图: 练习二 1、主函数输入温度 2、通过str切片操作,判断末尾是什么摄氏度 3、转化为其他形式摄氏度 运行截图: 阅读全文
posted @ 2018-09-03 10:03 dafeifeifei 阅读(191) 评论(0) 推荐(0) 编辑