会员
周边
新闻
博问
AI培训
云市场
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
王滢
博客园
首页
新随笔
联系
管理
订阅
2018年6月20日
期末综合大作业:词频统计
摘要: #1, letFile = open('let.txt','r') letTest = letFile.read() letFile.close() print(letTest) #2, print(letTest.replace(',',' ')) print(letTest.replace("'
阅读全文
posted @ 2018-06-20 21:35 王滢
阅读(189)
评论(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(2,'A','B','C')
阅读全文
posted @ 2018-06-13 21:20 王滢
阅读(167)
评论(0)
推荐(0)
编辑
2018年6月6日
列表、元组、字典、集合的定义、操作与综合练习
摘要: l = ['AA','BB','CC'] l.append('BB') l.pop() print(1) t = ('AA','BB','CC') scores = [88,99,100] d = {'AA':88,'BB':99,'CC':100} d['BB'] = 95 d['Want'] =
阅读全文
posted @ 2018-06-06 21:31 王滢
阅读(167)
评论(0)
推荐(0)
编辑
2018年5月30日
文件操作,列表实例NiceHexSpiral
摘要: fr = open('88.txt',mode='r', encoding='utf-8') planincode = fr.read() print('明文:' + planincode) print('密文:',end='') for c in planincode: print(chr(ord(c)+3),end='') fr = open('88.txt',mode='r...
阅读全文
posted @ 2018-05-30 21:22 王滢
阅读(171)
评论(0)
推荐(0)
编辑
2018年5月23日
字符串操作
摘要: stuNum = '201709090022' print('年级是:'+stuNum[0:4]) print('专业编号是:'+stuNum[4:9]) print('序号是:'+stuNum[-3:]) IDNo= '44000202199812010027' print('省市是:'+IDNo[0:2]) print('生日是:'+IDNo[-8:-4]) print('性别是:'+ID...
阅读全文
posted @ 2018-05-23 21:18 王滢
阅读(160)
评论(0)
推荐(0)
编辑
2018年5月16日
函数定义与使用
摘要: stuNum = '201709080008' print('年级是:'+stuNum[0:4]) print('专业编号是:'+stuNum[4:9]) print('序号是:'+stuNum[-3:]) IDNo = '440105199505160425' print('性别是:'+IDNo[-2]) import turtle turtle.setup(600,400,0,0...
阅读全文
posted @ 2018-05-16 20:53 王滢
阅读(197)
评论(0)
推荐(0)
编辑
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:56 王滢
阅读(244)
评论(0)
推荐(0)
编辑
2018年5月2日
程序执行流程/布尔类型与布尔:运算猜数字游戏;库的使用:turtle
摘要: import turtle import time turtle.fillcolor('red') turtle.begin_fill() turtle.forward(100) turtle.right(144) time.sleep(1) turtle.forward(100) turtle.right(144) time.sleep(1) turtle.forward(100) turt...
阅读全文
posted @ 2018-05-02 21:38 王滢
阅读(277)
评论(0)
推荐(0)
编辑
2018年4月25日
条件语句,while循环语句:完整的温度转换程序
摘要: a=int(input('摄氏温度转为华氏温度请按1\n华氏温度转为摄氏温度请按2\n')) if a=='1': c=input('请输入摄氏温度:') f=float(c)*9/5+32 print('{}摄氏温度转为华氏温度是:{}'.format(c,f)) else: f=float(in
阅读全文
posted @ 2018-04-25 21:03 王滢
阅读(262)
评论(0)
推荐(0)
编辑
温度转换
摘要: a=int(input('摄氏温度转为华氏温度请按1\n华氏温度转为摄氏温度请按2\n')) if a=='1': c=input('请输入摄氏温度:') f=float(c)*9/5+32 print('{}摄氏温度转为华氏温度是:{}'.format(c,f)) else: f=float(in
阅读全文
posted @ 2018-04-25 20:40 王滢
阅读(161)
评论(0)
推荐(0)
编辑
下一页
公告