会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
朱靖萍
博客园
首页
新随笔
联系
订阅
管理
2018年6月20日
期末综合大作业:词频统计
摘要: #1. bigFile = open('big.txt',mode='r',encoding='utf-8') bigText=bigFile.read() bigFile.close() print(bigText) #2. replaceList=[',','.',"'",'\n'] for c
阅读全文
posted @ 2018-06-20 21:34 朱靖萍
阅读(96)
评论(0)
推荐(0)
2018年6月13日
递归,汉诺塔游戏
摘要: def hanoi(n,a,b,c): if n==1: print(n,a+'->'+c) else: hanoi(n-1,a,c,b) print(n,a+'->'+c) hanoi(n-1,b,a,c) hanoi(8,'A','B','C')
阅读全文
posted @ 2018-06-13 21:44 朱靖萍
阅读(96)
评论(0)
推荐(0)
2018年6月6日
列表、元组、字典、集合的定义、操作与综合练习
摘要: l = ['Michael','Bob','Tracy'] l.append('Bob') l.pop() print(1) t = ('Michael','Bob','Tracy') scores = [95,85,75] d = {'Michael':95,'Bob':85,'Tracy':75} d['Bob'] = 82 d['Rose'] = 88 d.pop('Bob') p.
阅读全文
posted @ 2018-06-06 21:26 朱靖萍
阅读(260)
评论(0)
推荐(0)
2018年5月23日
字符串操作
摘要: id= '440404199810072828' area = id[0:6] birthday = id[6:14] sex = id[-2] print(area,birthday,sex) if (int(sex) % 2 == 0): print('girl') else: print('boy') for i in range(12): print(9...
阅读全文
posted @ 2018-05-23 21:41 朱靖萍
阅读(123)
评论(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.goto(x,y) turtle.pendown() def dra...
阅读全文
posted @ 2018-05-16 20:38 朱靖萍
阅读(142)
评论(0)
推荐(1)
2018年5月9日
for循环:用turtle画一颗五角星
摘要: import turtle # 设置初始位置 turtle.penup() turtle.left(90) turtle.fd(200) turtle.pendown() turtle.right(90) # 花蕊 turtle.fillcolor("red") turtle.begin_fill() turtle.circle(10, 180) turtle.circle(25, ...
阅读全文
posted @ 2018-05-09 20:57 朱靖萍
阅读(203)
评论(0)
推荐(0)
2018年5月2日
程序执行流程/布尔类型与布尔:运算猜数字游戏;库的使用:turtle
摘要: myNumber = 7 while True: guess = int(input('请输入一个数量:')) if guess > myNumber: print('输入的数量过大') elif guess < myNumber: print('输入的数量过小') else: print('输入的
阅读全文
posted @ 2018-05-02 21:22 朱靖萍
阅读(138)
评论(0)
推荐(0)
2018年4月25日
理解数据类型与数字运算:求和、温度转换1
摘要: a=input('请输入摄氏温度') sum2=int(a)*5/9+32 print('转换的摄氏度是:{}'.format(sum2)) a=input('请输入华氏温度') sum2=int(a)*5/9-32 print('转换的摄氏温度是;{}'.format(sum2))
阅读全文
posted @ 2018-04-25 20:16 朱靖萍
阅读(201)
评论(0)
推荐(0)
理解数据类型与数字运算:求和、温度转换
摘要: 请输入摄氏温度5 转换的摄氏度是:34.77777777777778 >>>
阅读全文
posted @ 2018-04-25 19:50 朱靖萍
阅读(127)
评论(0)
推荐(0)
2018年4月18日
输入、输出与Mad Libs 游戏
摘要: == RESTART: C:/Users/teacher/AppData/Local/Programs/Python/Python36-32/2.py == 请输入一个名字: == RESTART: C:/Users/teacher/AppData/Local/Programs/Python/Python36-32/2.py == 请输入一个名字:鹿晗 再输入一个名字:屁屁 请输入一辆车:兰博基...
阅读全文
posted @ 2018-04-18 21:38 朱靖萍
阅读(255)
评论(0)
推荐(0)
公告