摘要:
1.下载一中文长篇小说,并转换成UTF-8编码。 2.使用jieba库,进行中文词频统计,输出TOP20的词及出现次数。 3.排除一些无意义词、合并同一词。 import jieba txt=open('kobe.txt','r',encoding='UTF-8').read() for i in 阅读全文
摘要:
1.字典实例:建立学生学号成绩字典,做增删改查遍历操作。 2.列表,元组,字典,集合的遍历。 a=list('1357') print('遍历列表:') for i in a: print(i) b=tuple('2468') print('遍历元组:') for i in b: print(i) 阅读全文
摘要:
1.实例: 下载一首英文的歌词或文章,将所有,.?!等替换为空格,将所有大写转换为小写,统计某几个单词出现的次数,分隔出一个一个的单词。 song='''I messed up tonight, I lost another fight I still mess up but I'll just s 阅读全文
摘要:
a.画五角星 import turtleturtle.color('yellow')turtle.fillcolor('yellow')turtle.bgcolor('red')turtle.begin_fill()for i in range(5): turtle.forward(100) tur 阅读全文