09 2017 档案
摘要:1.下载一中文长篇小说,并转换成UTF-8编码。 2.使用jieba库,进行中文词频统计,输出TOP20的词及出现次数。 3.排除一些无意义词、合并同一词。 4.对词频统计 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 import jieba txt = open(
阅读全文
摘要:>>> fo.open('coffee.txt','r')coffee=fo.read()coffee=coffee.lower()for i in ',.': coffee=coffee.replace(i,' ')words=coffee.split(' ')exp={'','the','a',
阅读全文
摘要:1 >>> d={'01':95,'02':92,'03':86,'04':70}>>> print(d){'01': 95, '02': 92, '03': 86, '04': 70}>>> d['05']=80>>> print(d){'01': 95, '02': 92, '03': 86,
阅读全文
摘要:1、实例: 下载一首英文的歌词或文章,将所有,.?!等替换为空格,将所有大写转换为小写,统计某几个单词出现的次数,分隔出一个一个的单词。 song='''i'm a big big girl, in a big big world ,it's not a big big thing if you l
阅读全文
摘要:1、a=input('明文:') print('密文:',end='') for i in a: print(chr(ord(a)+3)) 2、print('国际名称 GDP总量(人民币亿元)') print('{0: <5} ¥{1: >15,.4f}'.format('中国',765873.43
阅读全文
摘要:1、 from turtle import * for i in range(5) forward(200) right(144) 2、 from turtle import *for i in range(5): circle(20*i) up() goto(0,-20*i) down() wri
阅读全文
摘要:1、 import turtle turtle.circle(10) turtle.circle(20) tuitle circle(30) 2、 turtle.circle(20) turtle.up() turtle.goto(0,-15) turtle.down() turtle.circle
阅读全文
摘要:1、简单的输入输出交互。 input('please input your name:') please input your name: coffee'coffee', 2、用一条式子求出两数之和。 x=input('输入第一个数:') 输入第一个数:1 y=input('输入第二个数:') 输入
阅读全文
摘要:1.信息与数据的区别是什么? 答:数据:对客观事物的性质、状态以及相互关系等进行记载的物理符号或是这些物理符号的组合,也包含数值数据和非数值数据。 信息:是数据经过加工处理后得到的另一种形式的数据,这种数据在某种程度上影响接收者的行为。具有客观性、主观性和有用性。 关系:信息是数据的含义,数据是信息
阅读全文