会员
T恤
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Eudoraxi
博客园
首页
新随笔
联系
订阅
管理
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(9,'A','B','C')
阅读全文
posted @ 2018-06-13 22:20 李紫柔
阅读(97)
评论(0)
推荐(0)
2018年6月6日
作业阿
摘要: l = ['Michael','Bob','Tracy'] l.append('Bob') l.pop() print(1) t = ('Michael','Bob','Tracy') scores = [95,85,65] d = {'Michael':95,'Bob':85,'Tracy':65
阅读全文
posted @ 2018-06-06 21:12 李紫柔
阅读(92)
评论(0)
推荐(0)
2018年5月30日
文件操作
摘要: fr = open('lzr.txt',mode='r',encoding='utf-8') zyx = fr.read() print('明文:' + zyx) print('密文:',end='') for c in zyx: print(chr(ord(c)+3),end='')
阅读全文
posted @ 2018-05-30 21:14 李紫柔
阅读(96)
评论(0)
推荐(0)
2018年5月23日
字符串操作
摘要: id= '44011119980513002X' 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 20:00 李紫柔
阅读(109)
评论(0)
推荐(0)
2018年5月16日
函数定义与使用
摘要: stuNum = '201709080050' print('年级是:'+stuNum[0:4]) print('专业编号是:'+stuNum[4:9]) print('序号是:'+stuNum[-3:]) IDNo= '44011119980513002X' print('省市是:'+IDNo[0:2]) print('生日是:'+IDNo[-8:-4]) print('性别是:'+IDN...
阅读全文
posted @ 2018-05-16 20:14 李紫柔
阅读(124)
评论(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, 110) ...
阅读全文
posted @ 2018-05-09 20:34 李紫柔
阅读(560)
评论(0)
推荐(0)
2018年5月6日
作业
摘要: number = 65 while True: guess = int(input('请输入一个数字:')) if guess > number: print('猜的数字大了') elif guess >> import turtle >>> turtle.left(50) >>> turtle.circle(50) >>> turtle.forward...
阅读全文
posted @ 2018-05-06 21:13 李紫柔
阅读(120)
评论(0)
推荐(0)
2018年5月2日
数字
摘要: myNumber =65 while True: guess = int(input('请输入数字')) if guess > myNumber: print('输入的数字大了') elif guess < myNumber: print('输入的数字小了') else: print('恭喜你猜对了
阅读全文
posted @ 2018-05-02 20:30 李紫柔
阅读(75)
评论(0)
推荐(0)
2018年4月27日
温度
摘要: a=int(input ('摄氏度转换为华氏度请按 1\n华氏度转换为摄氏度请按 2\n')) if a==1: c = float(input('请输入摄氏温度:')) f = c*9/5+32 print('{:.2f}°C转换成华氏温度为{:.2f}°F'.format(c,f)) else:
阅读全文
posted @ 2018-04-27 22:37 李紫柔
阅读(242)
评论(0)
推荐(0)
2018年4月22日
zuoye
摘要: a=input('请输入一个数字:') b=input('请再输入一个数字') sum2=int(a)+int(b) print('两个数字的和是:{}'.format(sum2)) a=input('请输入一个摄氏温度') sum2=int(a)*9/5+32 print('转换的华氏温度是:{}'.format(sum2))
阅读全文
posted @ 2018-04-22 20:16 李紫柔
阅读(393)
评论(0)
推荐(0)
下一页
公告
点击右上角即可分享