摘要: import jieba #打开文件,转换成UTF-8编码 fo=open(r'C:\Users\Shaheen\AppData\Local\Programs\Python\Python36\西游记.txt','r',encoding='utf-8') a=fo.read() fo.close() #断词 words=list(jieba.cut(a)) s=set(words) dic={... 阅读全文
posted @ 2017-09-29 12:21 044潘育珊 阅读(155) 评论(0) 推荐(0) 编辑
摘要: fo=open('D:/jiu/test.txt','w') fo.write('''Ohh wooaah You know you love me,I know you care You shout whenever, And I'll be there You want my love, You want my heart And we will never ever ever b... 阅读全文
posted @ 2017-09-26 09:53 044潘育珊 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 1 字典实例:建立学生学号成绩字典,做增删改查遍历操作 a={'01':100,'02':89,'03':88,'04':90}print('字典',a)a['05']=88print('增加05学生成绩为88',a)a.pop('02')print('删除02的学生成绩',a)print('查找0 阅读全文
posted @ 2017-09-22 13:19 044潘育珊 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 1 实例: 下载一首英文的歌词或文章,将所有,.?!等替换为空格,将所有大写转换为小写,统计某几个单词出现的次数,分隔出一个一个的单词 song='''Ohh wooaah You know you love me,I know you care You shout whenever, And I' 阅读全文
posted @ 2017-09-20 20:50 044潘育珊 阅读(72) 评论(0) 推荐(0) 编辑
摘要: 1. a=input('明文:')print('密文:',end='')for i in a: print(chr(ord(i)+3),end='') 2 print('{0:''<5}{1:<6}{2:<7}'.format('国家名称','GDP总量','(人民币亿元)'))print('{0: 阅读全文
posted @ 2017-09-19 09:56 044潘育珊 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 1.已知‘星期一星期二星期三星期四星期五星期六星期日 ’,输入数字(1-7),输出相应的‘星期几’ n='星期一星期二星期三星期四星期五星期六星期七'd=int(input('1-7:'))print(n[3*(d-1):3*d]) 2.输入学号,识别年级、专业、班级、序号 n='201506050 阅读全文
posted @ 2017-09-15 21:36 044潘育珊 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 画五角星 import turtleturtle.bgcolor('red')turtle.color('yellow')turtle.fillcolor('yellow')turtle.begin_fill()for i in range(5): turtle.forward(80) turtle 阅读全文
posted @ 2017-09-12 11:02 044潘育珊 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 画一组同切圆 import turtleturtle.circle(50)turtle.circle(60)turtle.circle(70)turtle.circle(80) 画一组同心圆 import turtleturtle.circle(60)turtle.up()turtle.goto(6 阅读全文
posted @ 2017-09-08 09:54 044潘育珊 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 1. >>> print('hello world')hello world>>> input("what's your name?")what's your name?apple'apple'>>> a='star'>>> print(a)star 2.多行: >>> a=input('输入第一个 阅读全文
posted @ 2017-09-06 20:50 044潘育珊 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 1. 数据是反映客观事物属性的记录,是可鉴别的符号 信息是数据经过加工处理之后,就成为信息,含有一定含义的数据,或者说我们人类可以直接理解的内容 2. 信息是对客观世界各种事物的特征的反映,是具有关联性和目的性的结构化、组织化的数据。 所谓知识,就是反映各种事物的信息进入人们大脑,经过人脑加工,对神 阅读全文
posted @ 2017-09-05 10:36 044潘育珊 阅读(130) 评论(0) 推荐(0) 编辑