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:24 杨瑶瑶 阅读(89) 评论(0) 推荐(0) 编辑

2018年6月6日

摘要: l = ['Michael','Bob','Tracy'] l.append('Tracy') l.pop() print(1) t = ('Michael','Bob','Tracy') scores = [85,65,55] d = {'Michael':85,'Bob':65,'Tracy':55} d['Bob'] = 82 d['Rose'] = 88 d.pop('Bob') 阅读全文
posted @ 2018-06-06 21:38 杨瑶瑶 阅读(147) 评论(0) 推荐(0) 编辑

2018年5月30日

摘要: fr = open('letter.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('letter.txt',... 阅读全文
posted @ 2018-05-30 21:39 杨瑶瑶 阅读(90) 评论(0) 推荐(0) 编辑

2018年5月23日

摘要: id='430523199905084345' area= id[0:6] birthday=id[6:14] sex=id[-2] print('市区是:'+area+'\n生日是:'+birthday) if (int(sex)%2==0): print('girl') else: print('boy') for i in range(12): pri... 阅读全文
posted @ 2018-05-23 21:23 杨瑶瑶 阅读(93) 评论(0) 推荐(0) 编辑

2018年5月16日

摘要: stuNum = '201709080018' print('年级是:'+stuNum[0:4]) print('专业编号是:'+stuNum[4:9]) print('序号是:'+stuNum[-3:]) IDNo = '430523199905084345' print('性别是:'+IDNo[ 阅读全文
posted @ 2018-05-16 21:38 杨瑶瑶 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 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:44 杨瑶瑶 阅读(126) 评论(0) 推荐(0) 编辑

2018年5月9日

摘要: 2. 3. 阅读全文
posted @ 2018-05-09 20:53 杨瑶瑶 阅读(224) 评论(0) 推荐(0) 编辑

2018年5月2日

摘要: mynumber = 8 while True: guess = int(input()) if guess > mynumber: print('>') elif guess < mynumber: print('<') else: print('') break import turtle ... 阅读全文
posted @ 2018-05-02 21:41 杨瑶瑶 阅读(134) 评论(0) 推荐(0) 编辑

2018年4月25日

摘要: while True: a=int(input('摄氏转华氏请按1\n华氏转摄氏请按2\n退出请按3\n')) if a==1: c=float(input('请输入摄氏度温度:')) f=c*9/5+32 print('摄氏{:.2f}的华氏为{;.2f}') elif a==2: f = flo 阅读全文
posted @ 2018-04-25 21:34 杨瑶瑶 阅读(131) 评论(0) 推荐(0) 编辑

2018年4月18日

摘要: 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-18 21:45 杨瑶瑶 阅读(86) 评论(0) 推荐(0) 编辑

导航