摘要:
.中文分词 下载一中文长篇小说,并转换成UTF-8编码。 使用jieba库,进行中文词频统计,输出TOP20的词及出现次数。 排除一些无意义词、合并同一词。 import jieba txt=open('test.txt','r',encoding='UTF-8').read() for i in 阅读全文
摘要:
实例: 下载一首英文的歌词或文章,将所有,.?!等替换为空格,将所有大写转换为小写,统计某几个单词出现的次数,分隔出一个一个的单词。 news=('''When I was young I'd listen to the radio Waiting for my favorite songs Whe 阅读全文
摘要:
1、画五角星 import turtleturtle.color('yellow')turtle.bgcolor('red')turtle.begin_fill()for i in range(5):turtle.forward(100)turtle.right(144)turtle.end_fil 阅读全文
摘要:
1.简单输入输出交互 print('Hello!')input('please input your name;')name=input('你好')print(name)print('hi,你好%s'%name) 结果为: Hello!please input your name;山崎贤人你好 hi 阅读全文