会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
吴树生
博客园
首页
新随笔
联系
管理
订阅
2018年6月20日
期末综合大作业:词频统计1
摘要: f=open('son.txt',mode='r',encoding='utf-8') fText = f.read()print(fText)replaceList = ['?',',','.',';']for c in replaceList: fText = fText.replace(c,'
阅读全文
posted @ 2018-06-20 20:35 吴树生
阅读(100)
评论(0)
推荐(0)
2018年6月13日
期末综合大作业:词频统计
摘要: f=open('son.txt',mode='r',encoding='utf-8')fText = f.read()print(fText)replaceList = ['?',',','.',';']for c in replaceList: bigText = bigText.replace(
阅读全文
posted @ 2018-06-13 21:24 吴树生
阅读(134)
评论(0)
推荐(0)
2018年6月6日
列表、元组、字典、集合的定义与操作
摘要: l = ['Michael','Bob','Tracy'] l.append('Bob') l.pop() print(1) t = ('Michael','Bob','Tracy') scores = [85,65,55] d = {'Michael':85,'Bob':65,'Tracy':55
阅读全文
posted @ 2018-06-06 21:17 吴树生
阅读(430)
评论(0)
推荐(1)
2018年5月30日
letter
摘要: fr=open('letter.txt',mode='r',encoding='utf-8')plaincode = fr.read()print('明文:'+plaincode)print('密文:',end='')open('letter.txt',mode='r',encoding='utf-8')for c in plaincode: print(chr (ord(c)+3),e...
阅读全文
posted @ 2018-05-30 20:48 吴树生
阅读(256)
评论(0)
推荐(0)
2018年5月23日
字符串操作
摘要: for i in range(12): print(9800+i,chr(9800+i)) id= '445221199803106993'area = id[0:6]birthday = id[3:10]sex = id[-1]print(area,birthday,sex)if (int(sex) % 2 == 0): print('girl')else: print('b...
阅读全文
posted @ 2018-05-23 20:25 吴树生
阅读(157)
评论(0)
推荐(0)
函数定义与使用,字符串类型
摘要: stuNum='201709080063'print('年级是:'+stuNum[0:4])print('专业编号是;+stuNum[4:9]')print('序号是;'+stuNum[-3:])IDNo= '445221199803106993'print('省市是:'+IDNo[0:2])pri
阅读全文
posted @ 2018-05-23 19:55 吴树生
阅读(108)
评论(0)
推荐(0)
2018年5月16日
五角星
摘要: import turtle turtle.setup(600,400,0,0) turtle.bgcolor('red') turtle.color('yellow') turtle.fillcolor('yellow') def mygoto(x,y): turtle.penup() turtle
阅读全文
posted @ 2018-05-16 20:12 吴树生
阅读(176)
评论(0)
推荐(0)
2018年5月9日
for循环:用turtle画一颗五角星q
摘要: import turtle # 设置初始位置 turtle.penup()turtle.left(90)turtle.fd(200)turtle.pendown()turtle.right(90) # 花蕊 turtle.fillcolor("red")turtle.begin_fill()turt
阅读全文
posted @ 2018-05-09 20:13 吴树生
阅读(257)
评论(0)
推荐(0)
for循环:用turtle画一颗五角星
摘要: import turtle# 设置初始位置 turtle.penup()turtle.forward(100)turtle.right(144)turtle.forward(100)turtle.right(144)turtle.forward(100)turtle.right(144)turtle
阅读全文
posted @ 2018-05-09 20:05 吴树生
阅读(162)
评论(0)
推荐(0)
2018年5月2日
猜数
摘要: number = 7while True: guess = int(input('输入一个数字\n')) if guess > number: input('比这个数大') elif guess < number: input('比这个数小') else: print('恭喜你答对了') break
阅读全文
posted @ 2018-05-02 20:30 吴树生
阅读(197)
评论(0)
推荐(0)
下一页
公告