会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
李凌正
博客园
首页
新随笔
联系
管理
订阅
2018年6月20日
词频统计
摘要: #1.salahFile = open('salah.txt',mode="r",encoding='utf-8')salahText = salahFile.read()salahFile.close()print(salahText)#2.replaceList = [',','.',"'",'
阅读全文
posted @ 2018-06-20 21:13 李凌正
阅读(111)
评论(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(7,'A','B','C')
阅读全文
posted @ 2018-06-13 21:01 李凌正
阅读(97)
评论(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}d['Bo
阅读全文
posted @ 2018-06-06 21:42 李凌正
阅读(128)
评论(0)
推荐(0)
2018年5月30日
文件操作
摘要: fr = open('salah.txt', mode='r', encoding='utf-8')plaincode=fr.read()print('明文:'+plaincode)print('密文:',end='')for c in plaincode: print(chr(ord(c)+3),end='') fr = open('salah.txt',mode='r',encoding...
阅读全文
posted @ 2018-05-30 21:34 李凌正
阅读(121)
评论(0)
推荐(0)
2018年5月23日
字符串操作
摘要: id = '440802199707180017'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(9800+i,chr(9...
阅读全文
posted @ 2018-05-23 21:13 李凌正
阅读(169)
评论(0)
推荐(0)
函数定义与使用,字符串类型
摘要: stuNum = '201709080030'print('年级是:'+stuNum[0:4])print('专业编号是:'+stuNum[4:9])print('序号是:'+stuNum[-3:])IDNo= '440802199707180017'print('省市是:'+IDNo[0:2])p
阅读全文
posted @ 2018-05-23 19:58 李凌正
阅读(91)
评论(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:13 李凌正
阅读(159)
评论(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()turt
阅读全文
posted @ 2018-05-09 20:51 李凌正
阅读(265)
评论(0)
推荐(0)
2018年5月2日
程序执行流程/布尔类型与布尔:运算猜数字游戏;库的使用:turtle
摘要: number = 6while True: guess = int(input('估数字啊柒头\n')) if guess > number: input('大閪咗啊柒头') elif guess < number: input('细閪咗啊柒头') else: print('估閪啱咗喔,咁犀利噶你个
阅读全文
posted @ 2018-05-02 20:31 李凌正
阅读(157)
评论(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(inpu
阅读全文
posted @ 2018-04-25 21:22 李凌正
阅读(201)
评论(0)
推荐(0)
下一页
公告